Vulnerabilities in pkg:pypi/djust
PACKAGEGHSA-xjw9-38cr-6372 is a HIGH cross-site scripting vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting djust libraries in the PyPI ecosystem. The issue involves a template binding inherits a context safety grant it never earned (xss). Remediation is available by upgrading affected packages to version 1.1.2.
pkg:pypi/djust
Vulnerability advisories affecting package pkg:pypi/djust. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-xjw9-38cr-6372 | - | HIGH | djust: A template binding inherits a context safety grant it never earned (XSS) |
| GHSA-9395-2g46-rj3f | - | HIGH | djust: Six template-layer defects emit attacker-controlled markup unescaped (XSS) |
| GHSA-7prp-2623-8g45 | CVE-2026-61599 | HIGH | djust has an unauthenticated arbitrary module import via the WebSocket/SSE view-mount path |
| GHSA-v9rj-xjfv-xj9r | CVE-2026-61589 | MODERATE | djust: WebSocket/runtime reconstructed request omits the client Host, causing host/subdomain TenantResolvers to misresolve the tenant on the live path |
| GHSA-c7c5-5j6r-q957 | CVE-2026-61596 | HIGH | djust has broken object-level access control (IDOR) |
| GHSA-pvg3-6q9j-mj3x | CVE-2026-61588 | MODERATE | djust's Django model serialization has no sensitive-field denylist: password hashes, privilege flags, and PII on a public view attribute are sent to the client |
| GHSA-xhhm-f6hp-2qwj | CVE-2026-61594 | CRITICAL | djust has an authorization bypass on the WebSocket/SSE mount path |
| GHSA-c67v-vqrp-m5wj | CVE-2026-61591 | HIGH | djust: Unsigned client state snapshot is restored as trusted view state (privilege escalation / state injection) |
| GHSA-f795-p5jw-j6g2 | CVE-2026-61592 | HIGH | djust: SSE sessions are not bound to the authenticated user; the client-chosen session_id is the sole authorization capability (session hijack) |
| GHSA-4mf4-73j6-mvrw | CVE-2026-61597 | MODERATE | djust is vulnerable to stored/reflected XSS via javascript: URLs in built-in component template tags |
| GHSA-pg97-jvmf-qfvc | CVE-2026-61593 | HIGH | djust has Cross-Site Request Forgery on the Server-Sent-Events transport: a cross-origin page can drive a victim-authenticated SSE session |
| GHSA-3492-cvg7-9mr2 | CVE-2026-61595 | HIGH | djust: Multi-tenant isolation fails open on the WebSocket/SSE path, disclosing other tenants' data |
| GHSA-cc7c-9jff-58wj | CVE-2026-61598 | HIGH | djust: Client mass-assignment of arbitrary view attributes via the default dj-model update_model handler |
| GHSA-8g2f-g3gq-5rjv | CVE-2026-61590 | HIGH | djust's observability endpoints are network-exposed: the localhost gate is an opt-in middleware the docs omit, and the views enforce only DEBUG |
| GHSA-xx4j-w367-7247 | CVE-2026-55571 | HIGH | djust authentication bypass: a login_required / on_mount LiveView mount redirect does not close the WebSocket, allowing an unauthenticated client to dispatch event-handler calls |
GHSA-xjw9-38cr-6372 at a Glance
How to Fix GHSA-xjw9-38cr-6372
To remediate this vulnerability, upgrade all affected djust dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install djust>=1.1.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show djust
How to Check if You Are Affected
To determine whether your Python environment is affected by GHSA-xjw9-38cr-6372, inspect your installed packages using pip:
pip show djust
Analyze the terminal output to locate any version of djust in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.2), your application is affected.
Note: The pip show djust command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In djust, 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
GHSA-xjw9-38cr-6372 Affected djust Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
djust
|
PyPI |
< 1.1.2
|
1.1.2
|
References
Frequently Asked Questions
What is GHSA-xjw9-38cr-6372?
Which djust versions are affected?
What version fixes GHSA-xjw9-38cr-6372?
Is djust affected?
What CWE is associated with GHSA-xjw9-38cr-6372?
How can I check PyPI dependencies for GHSA-xjw9-38cr-6372?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xjw9-38cr-6372",
"modified" : "2026-09-17T20:31:48Z",
"published" : "2026-09-17T20:31:48Z",
"aliases" : [ ],
"summary" : "djust: A template binding inherits a context safety grant it never earned (XSS)",
"details" : "A context safety grant was inherited by a template **binding** that never earned it, so rebinding a name the view had marked safe left the mark attached to the new, attacker-controlled value.\n\ndjust's context safety channel is keyed by **name**, not by value. Every bind copied the value and left the grant in place:\n\n```\nview marks p = mark_safe('<b>trusted</b>')\ntemplate {% with p=user_input %}{{ p }}{% endwith %}\n\n djust '<img src=x onerror=alert(1)>' <- executes\n django '<img src=x onerror=alert(1)>'\n```\n\n## Affected binds\n\nEight distinct shapes were live. All are fixed in 1.1.2:\n\n| shape | example |\n|---|---|\n| `{% with %}` rebinding a marked name | `{% with p=hostile %}{{ p }}{% endwith %}` |\n| `{% with %}` **descendant** of a rebound name | `{% with p=hostile %}{{ p.a }}{% endwith %}` |\n| `{% with %}` binding over a marked name | `{% with q=hostile %}{{ q }}{% endwith %}` |\n| `{% for %}` loop variable | `{% for p in hostiles %}{{ p }}{% endfor %}` |\n| `{% for %}` descendant | `{% for p in hostiles %}{{ p.a }}{% endfor %}` |\n| `{% for %}` tuple unpacking | `{% for k, v in rows %}{{ v }}{% endfor %}` |\n| `{% include … with %}` | `{% include \"c.html\" with q=hostile %}` |\n| assign tags | `{% … as x %}` |\n\nNo filter chain and no `|safe` anywhere in the template is required. The precondition is that the application marked *some* value safe under a name that a template later rebinds — an ordinary pattern, since a view commonly marks trusted markup safe and templates commonly reuse short names such as `p`, `item` or `row`.\n\n## Impact\n\nStored or reflected XSS in any djust application that combines `mark_safe` (or any framework path that grants a context key safety) with a template that rebinds that name. Exploitation requires no unusual template construct.\n\n## Patches\n\nFixed in **1.1.2**, and in 1.2.0 (`main`).\n\nThe rule is that a bind **replaces** the grant rather than inheriting one. It is stated that way deliberately: the originally reported defects pointed the *opposite* direction — a grant being **lost** across some binds, causing over-escaping — and fixing only the reported direction would have left this leak in place. Both directions are the same rule.\n\n**Not fixed in 1.1.2**, and tracked for 1.2.0: two over-escaping cases where a grant fails to travel with a value that legitimately carries one (`{% with body=post.text|linebreaks %}`, and `mark_safe` reaching a template through `dict.values` / `dict.items`). Both escape *more* than Django rather than less, so neither is a leak.\n\n## Workarounds\n\nBefore upgrading, avoid reusing a context name for both `mark_safe`'d content and untrusted input, and avoid rebinding such a name in `{% with %}`, `{% for %}`, `{% include … with %}` or an assign tag.\n\n## Credit\n\nFound while preparing the 1.1.1 security release: the reproducer published in GHSA-9395-2g46-rj3f was run against the built 1.1.1 artifact before that advisory was published, and proved the class was still live. Publishing the original text would have reported this class as patched when it was not.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "djust"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.1.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/djust-org/djust/security/advisories/GHSA-xjw9-38cr-6372"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/djust-org/djust"
}, {
"type" : "WEB",
"url" : "https://github.com/djust-org/djust/releases/tag/v1.1.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-116", "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-09-17T20:31:48Z",
"nvd_published_at" : null
}
}