Vulnerabilities in pkg:pypi/django-unicorn

PACKAGE
Advisory Identifier: GHSA-ffv6-jj46-x367
Advisory Summary

CVE-2026-31815 is a MODERATE (CVSS 5.3) django-unicorn affected by component state vulnerability (CWE-284: Improper Access Control) affecting Django unicorn libraries in the PyPI ecosystem. The issue involves django-unicorn affected by component state manipulation via unvalidated attribute access. Remediation is available by upgrading affected packages to version 0.67.0.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/django-unicorn

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/django-unicorn. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-ffv6-jj46-x367 CVE-2026-31815 MODERATE django-unicorn affected by component state manipulation via unvalidated attribute access
GHSA-g9wf-5777-gq43 CVE-2025-24370 CRITICAL Django-Unicorn Class Pollution Vulnerability, Leading to XSS, DoS and Authentication Bypass
GHSA-ggmv-6q9p-9gm6 CVE-2021-42134 MODERATE Cross-site Scripting in django-unicorn
GHSA-c87f-fq5g-63r2 CVE-2021-42053 MODERATE Cross-site scripting in Unicorn framework

CVE-2026-31815 at a Glance

CVE Identifier CVE-2026-31815
GHSA Identifier GHSA-ffv6-jj46-x367
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-284: Improper Access Control
Affected Product Django unicorn
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-31815

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

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-31815, inspect your installed packages using pip:

pip show django-unicorn

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Django unicorn, 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 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: 1. 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>" } ``` 2. The server-side component updates its internal state: `self.template_name = "admin/base.html"`. 3. 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.

CVE-2026-31815 Affected Django unicorn Versions

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

References

Frequently Asked Questions

What is CVE-2026-31815?
CVE-2026-31815 is a security vulnerability in Django unicorn involving django-unicorn affected by component state manipulation via unvalidated attribute access under CWE-284: Improper Access Control.
Which Django unicorn versions are affected?
Affected versions include releases prior to 0.67.0 across affected packages: django-unicorn.
What version fixes CVE-2026-31815?
Upgrading to 0.67.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is django-unicorn affected?
Yes, django-unicorn is affected in releases prior to 0.67.0. Upgrade your dependency to 0.67.0 or later.
What is the CVSS score of CVE-2026-31815?
CVE-2026-31815 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-31815?
CVE-2026-31815 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check PyPI dependencies for CVE-2026-31815?
Run the dependency tree command: 'pip show django-unicorn'. 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-ffv6-jj46-x367",
  "modified" : "2026-03-11T05:45:51Z",
  "published" : "2026-03-11T00:11:08Z",
  "aliases" : [ "CVE-2026-31815" ],
  "summary" : "django-unicorn affected by component state manipulation via unvalidated attribute access",
  "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'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.\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\": \"<checksum_of_empty_dict>\"\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's configured template directories. Remote Code Execution (RCE) is not possible via this vector.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "django-unicorn"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.67.0"
      } ]
    } ]
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284", "CWE-915" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-11T00:11:08Z",
    "nvd_published_at" : "2026-03-10T22:16:19Z"
  }
}