GHSA-785h-76cm-cpmf: Django tomselect Django TomSelect Incomplete Escaping Of Vulnerability

LOW
CWE-116 CWE-79
Published
Advisory Summary

GHSA-785h-76cm-cpmf is a LOW django tomselect incomplete escaping of vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Django tomselect libraries in the PyPI ecosystem. The issue involves django tomselect incomplete escaping of dangerous characters in widget attributes. Remediation is available by upgrading affected packages to version 2025.3.3.

GHSA-785h-76cm-cpmf at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-785h-76cm-cpmf
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product Django tomselect
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix GHSA-785h-76cm-cpmf

To remediate this vulnerability, upgrade all affected Django tomselect dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

django-tomselect fixed: 2025.3.3
pip install django-tomselect>=2025.3.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show django-tomselect

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-785h-76cm-cpmf, inspect your installed packages using pip:

pip show django-tomselect

Analyze the terminal output to locate any version of Django tomselect in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2025.3.3), your application is affected.

Note: The pip show django-tomselect command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Django tomselect, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary User supplied values passed through to certain attributes in form widgets are not fully escaped for potentially dangerous tokens, and in some cases are rendered in browser as valid html tags. ### Details Attributes passed to the widget (such as `label_field`) containing `<`, `>`, and similar tokens are not fully escaped. This results in some raw values reaching the widget, and rendering in part or fully. For example, a label of: `"Test User <script>I can pass this to the label_field and it gets rendered</script>"` is rendered in the choices's label visually as `"Test User "` with the trailing space, and what appears as an un-executed script tag following it (which is visible when viewing source). The actual output rendered in the browser for this example is: `<div role="option" data-value="63f205b6" class="item" data-ts-item="">Test User <script>I can pass this to the label_field and it gets rendered</script></div>` The script tags appears to be valid in Chrome dev tools, but doesn't appear execute code. ### Impact Although the risk may be mediated since the content within the rendered `<script></script>` tags does not seem to actually/immediately run, potential may exist for other ways of increasing the risk (e.g.: code injection). In addition, the widget does not display correctly for valid strings containing `<` or `>`. Valid use-cases for printing these characters include widget label fields displaying email addresses (e.g.: `"User Jane <user.jane@example.com>"` Because of the relatively small number of users at this moment, our plan to yank affected releases on PyPI and GitHub, and because raw text is rendered but does not seem to be executable, I am marking the Severity **Low**. Update to version **5.3.3**. The only difference from 5.3.2 is the code and documentation changes to resolve this vulnerability, so the update process should not be problematic.

GHSA-785h-76cm-cpmf Affected Django tomselect Versions

1 component(s)
Fixed Versions:
2025.3.3
Product / Package Ecosystem Affected Versions Fixed Version
django-tomselect
PyPI
< 2025.3.3
2025.3.3

References

Frequently Asked Questions

What is GHSA-785h-76cm-cpmf?
GHSA-785h-76cm-cpmf is a security vulnerability in Django tomselect involving Django TomSelect incomplete escaping of dangerous characters in widget attributes under CWE-116: Improper Encoding or Escaping of Output.
Which Django tomselect versions are affected?
Affected versions include releases prior to 2025.3.3 across affected packages: django-tomselect.
What version fixes GHSA-785h-76cm-cpmf?
Upgrading to 2025.3.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is django-tomselect affected?
Yes, django-tomselect is affected in releases prior to 2025.3.3. Upgrade your dependency to 2025.3.3 or later.
What CWE is associated with GHSA-785h-76cm-cpmf?
GHSA-785h-76cm-cpmf is classified under CWE-116: Improper Encoding or Escaping of Output (The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.).
How can I check PyPI dependencies for GHSA-785h-76cm-cpmf?
Run the dependency tree command: 'pip show django-tomselect'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-785h-76cm-cpmf",
  "modified" : "2025-03-26T20:34:02Z",
  "published" : "2025-03-26T20:34:02Z",
  "aliases" : [ ],
  "summary" : "Django TomSelect incomplete escaping of dangerous characters in widget attributes",
  "details" : "### Summary\nUser supplied values passed through to certain attributes in form widgets are not fully escaped for potentially dangerous tokens, and in some cases are rendered in browser as valid html tags.\n\n### Details\nAttributes passed to the widget (such as `label_field`) containing `<`, `>`, and similar tokens are not fully escaped. This results in some raw values reaching the widget, and rendering in part or fully.\n\nFor example, a label of: `\"Test User <script>I can pass this to the label_field and it gets rendered</script>\"` is rendered in the choices's label visually as `\"Test User \"` with the trailing space, and what appears as an un-executed script tag following it (which is visible when viewing source).\n\nThe actual output rendered in the browser for this example is: `<div role=\"option\" data-value=\"63f205b6\" class=\"item\" data-ts-item=\"\">Test User <script>I can pass this to the label_field and it gets rendered</script></div>`\n\nThe script tags appears to be valid in Chrome dev tools, but doesn't appear execute code.\n\n### Impact\nAlthough the risk may be mediated since the content within the rendered `<script></script>` tags does not seem to actually/immediately run, potential may exist for other ways of increasing the risk (e.g.: code injection).  In addition, the widget does not display correctly for valid strings containing `<` or `>`. Valid use-cases for printing these characters include widget label fields displaying email addresses (e.g.: `\"User Jane <user.jane@example.com>\"`\n\nBecause of the relatively small number of users at this moment, our plan to yank affected releases on PyPI and GitHub, and because raw text is rendered but does not seem to be executable, I am marking the Severity **Low**.\n\nUpdate to version **5.3.3**. The only difference from 5.3.2 is the code and documentation changes to resolve this vulnerability, so the update process should not be problematic.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "django-tomselect"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2025.3.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/OmenApps/django-tomselect/security/advisories/GHSA-785h-76cm-cpmf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/OmenApps/django-tomselect/commit/0990ed36c8874f9d42fa9deff7734bf8dcd46d40"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/OmenApps/django-tomselect"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116", "CWE-79" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-03-26T20:34:02Z",
    "nvd_published_at" : null
  }
}