# GHSA-x9jp-4w8m-4f3c: Cross Site Scripting vulnerability in django-jsonform's admin form.

> Attackers can execute arbitrary scripts in Django admin pages via stored XSS in django-jsonform, requiring admin access to exploit.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 10 Jun 2022

## What is GHSA-x9jp-4w8m-4f3c?

GHSA-x9jp-4w8m-4f3c is a cross-site scripting vulnerability in django-jsonform, published on 10 Jun 2022. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

### Official description

### 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>`.

## Which versions are affected by GHSA-x9jp-4w8m-4f3c?

2 open source packages ship an affected version, including django-jsonform.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `django-jsonform` | PyPI | All versions | 2.10.1 |
| `django-jsonform` | PyPI | All versions | 2.10.1 |

## How do I fix GHSA-x9jp-4w8m-4f3c?

Upgrade django-jsonform to 2.10.1 or later.

## Is GHSA-x9jp-4w8m-4f3c being exploited?

There is no known exploitation of GHSA-x9jp-4w8m-4f3c in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-x9jp-4w8m-4f3c and fix it if it is affected.

What it is: GHSA-x9jp-4w8m-4f3c is a cross-site scripting vulnerability in django-jsonform, published on 10 Jun 2022. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-x9jp-4w8m-4f3c in the wild and no public exploit code.

Affected packages and fixed versions:
- django-jsonform (PyPI): affected all versions; fixed in 2.10.1
- django-jsonform (PyPI): affected all versions; fixed in 2.10.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-x9jp-4w8m-4f3c/ (Markdown: https://insights.sbomify.com/GHSA-x9jp-4w8m-4f3c/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-x9jp-4w8m-4f3c

---
From sbomify Insights: https://insights.sbomify.com/GHSA-x9jp-4w8m-4f3c/
Summaries are generated and may contain mistakes; the official description above is the record.
