GHSA-x9jp-4w8m-4f3c: Django jsonform Cross Site Scripting Vulnerability Vulnerability

HIGH
CWE-80 CWE-79
Published
Advisory Summary

GHSA-x9jp-4w8m-4f3c is a HIGH cross site scripting vulnerability vulnerability (CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)) affecting Django jsonform libraries in the PyPI ecosystem. The issue involves cross site scripting vulnerability in django-jsonform's admin form.. Remediation is available by upgrading affected packages to version 2.10.1.

GHSA-x9jp-4w8m-4f3c at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-x9jp-4w8m-4f3c
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)
Affected Product Django jsonform
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix GHSA-x9jp-4w8m-4f3c

To remediate this vulnerability, upgrade all affected Django jsonform 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-jsonform fixed: 2.10.1
pip install django-jsonform>=2.10.1
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-jsonform

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-x9jp-4w8m-4f3c, inspect your installed packages using pip:

pip show django-jsonform

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages. In Django jsonform, 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

### Description django-jsonform stores the raw JSON data of the db field in a hidden textarea on the admin page. However, that data was kept in the textarea after unescaping it using the `safe` template filter. This opens up possibilities for XSS attacks. This only affects the admin pages where the django-jsonform is rendered. ### Mitigation Upgrade to django-jsonform version 2.10.1 or later. ### For more information If you have any questions or comments about this advisory: * [Open an issue](https://github.com/bhch/django-jsonform/issues). * Email the maintainer at `Bharat Chauhan <tell.bhch@gmail.com>`.

GHSA-x9jp-4w8m-4f3c Affected Django jsonform Versions

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

References

Frequently Asked Questions

What is GHSA-x9jp-4w8m-4f3c?
GHSA-x9jp-4w8m-4f3c is a security vulnerability in Django jsonform involving Cross Site Scripting vulnerability in django-jsonform's admin form. under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS).
Which Django jsonform versions are affected?
Affected versions include releases prior to 2.10.1 across affected packages: django-jsonform.
What version fixes GHSA-x9jp-4w8m-4f3c?
Upgrading to 2.10.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is django-jsonform affected?
Yes, django-jsonform is affected in releases prior to 2.10.1. Upgrade your dependency to 2.10.1 or later.
What CWE is associated with GHSA-x9jp-4w8m-4f3c?
GHSA-x9jp-4w8m-4f3c is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) (The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages.).
How can I check PyPI dependencies for GHSA-x9jp-4w8m-4f3c?
Run the dependency tree command: 'pip show django-jsonform'. 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-x9jp-4w8m-4f3c",
  "modified" : "2022-06-10T19:51:18Z",
  "published" : "2022-06-10T19:51:18Z",
  "aliases" : [ ],
  "summary" : "Cross Site Scripting vulnerability in django-jsonform's admin form.",
  "details" : "### Description\n\ndjango-jsonform stores the raw JSON data of the db field in a hidden textarea on the admin page. However, that data was kept in the textarea after unescaping it using the `safe` template filter. This opens up possibilities for XSS attacks.\n\nThis only affects the admin pages where the django-jsonform is rendered.\n\n### Mitigation\n\nUpgrade to django-jsonform version 2.10.1 or later.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* [Open an issue](https://github.com/bhch/django-jsonform/issues).\n* Email the maintainer at `Bharat Chauhan <tell.bhch@gmail.com>`.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "django-jsonform"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.10.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/bhch/django-jsonform/security/advisories/GHSA-x9jp-4w8m-4f3c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bhch/django-jsonform"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79", "CWE-80" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-10T19:51:18Z",
    "nvd_published_at" : null
  }
}