GHSA-FFV6-JJ46-X367
Vulnerability from github – Published: 2026-03-11 00:11 – Updated: 2026-03-11 05:45Summary
Component state manipulation is possible in django-unicorn due to missing access control checks during property updates and method calls. An attacker can bypass the intended _is_public protection to modify internal attributes such as template_name or trigger protected methods.
Vulnerability Details: Component Access Control Bypass
Security analysis identified that the framework fails to enforce visibility boundaries defined by _is_public within the action parsers. Specifically, the logic in set_property_value() and _call_method_name() utilizes getattr and setattr directly on component instances without verifying if the target attribute or method is explicitly marked as public.
Vulnerability resides in:
- src/django_unicorn/views/action_parsers/call_method.py
- src/django_unicorn/views/action_parsers/utils.py
While Django's template engine restricts rendering to registered directories, an unauthorized user can still force a component to render sensitive templates (e.g., admin layouts) from other installed applications or reset the component state by invoking the internal reset() method.
Proof of Concept (PoC)
Attacker can overwrite the template_name attribute by sending a crafted JSON payload to the message endpoint:
- Construct a payload targeting a protected attribute:
json { "actionQueue": [ { "type": "syncInput", "payload": { "name": "template_name", "value": "admin/base.html" } } ], "data": {}, "meta": "<checksum_of_empty_dict>" } - The server-side component updates its internal state:
self.template_name = "admin/base.html". - Subsequent re-rendering displays the content of the targeted template, bypassing intended component logic.
Impact
Low severity. The risk is limited to unauthorized manipulation of component state and rendering of existing templates within the application's configured template directories. Remote Code Execution (RCE) is not possible via this vector.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "django-unicorn"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.67.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-31815"
],
"database_specific": {
"cwe_ids": [
"CWE-284",
"CWE-915"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-11T00:11:08Z",
"nvd_published_at": "2026-03-10T22:16:19Z",
"severity": "MODERATE"
},
"details": "## Summary\nComponent state manipulation is possible in `django-unicorn` due to missing access control checks during property updates and method calls. An attacker can bypass the intended `_is_public` protection to modify internal attributes such as `template_name` or trigger protected methods.\n\n## Vulnerability Details: Component Access Control Bypass\nSecurity analysis identified that the framework fails to enforce visibility boundaries defined by `_is_public` within the action parsers. Specifically, the logic in `set_property_value()` and `_call_method_name()` utilizes `getattr` and `setattr` directly on component instances without verifying if the target attribute or method is explicitly marked as public.\n\nVulnerability resides in:\n- `src/django_unicorn/views/action_parsers/call_method.py`\n- `src/django_unicorn/views/action_parsers/utils.py`\n\nWhile Django\u0027s template engine restricts rendering to registered directories, an unauthorized user can still force a component to render sensitive templates (e.g., admin layouts) from other installed applications or reset the component state by invoking the internal `reset()` method.\n\n## Proof of Concept (PoC)\nAttacker can overwrite the `template_name` attribute by sending a crafted JSON payload to the message endpoint:\n\n1. Construct a payload targeting a protected attribute:\n ```json\n {\n \"actionQueue\": [\n {\n \"type\": \"syncInput\",\n \"payload\": { \"name\": \"template_name\", \"value\": \"admin/base.html\" }\n }\n ],\n \"data\": {},\n \"meta\": \"\u003cchecksum_of_empty_dict\u003e\"\n }\n ```\n2. The server-side component updates its internal state: `self.template_name = \"admin/base.html\"`.\n3. Subsequent re-rendering displays the content of the targeted template, bypassing intended component logic.\n\n## Impact\nLow severity. The risk is limited to unauthorized manipulation of component state and rendering of existing templates within the application\u0027s configured template directories. Remote Code Execution (RCE) is not possible via this vector.",
"id": "GHSA-ffv6-jj46-x367",
"modified": "2026-03-11T05:45:51Z",
"published": "2026-03-11T00:11:08Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/django-commons/django-unicorn/security/advisories/GHSA-ffv6-jj46-x367"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31815"
},
{
"type": "PACKAGE",
"url": "https://github.com/django-commons/django-unicorn"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "django-unicorn affected by component state manipulation via unvalidated attribute access"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.