Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate as documentation contributor
-
DeliverySubmit OpenAPI doc containing </script><script> payload
-
ExploitContent embedded unescaped in inline config script
-
ExecutionVictim opens API reference page
-
ImpactInjected JavaScript executes in documentation origin
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the hosting application pass attacker-controlled OpenAPI content into scalar-ninja's server-side ScalarConfig.content or sources[].content (for example, a multi-tenant or contributor-driven docs portal), AND that the rendered API reference page permit inline scripts (no CSP blocking inline execution). The attacker needs low-privileged authenticated access to submit the document (CVSS PR:L; the PoC uses a standard documentation-contributor account), and a victim must open the API reference page (CVSS UI:P). LIMITING factors: it is not exploitable where the application never embeds untrusted OpenAPI documents, where a Content-Security-Policy forbids inline scripts, or without the required contributor-level submission and victim page view. Affected versions are scalar-ninja 0.1.0 through 0.3.1 (0.1.0, 0.1.1, 0.1.2, 0.2.0, 0.3.0, 0.3.1); fixed in 0.3.3. |
| Impact | This is a medium-severity stored cross-site scripting flaw (CVSS 4.0 base 5.1), not a high-urgency emergency. The supplied CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N) shows network reach and low attack complexity, but two signals materially constrain real-world risk: PR:L means the attacker needs at least low-privileged access (the GHSA PoC describes a standard documentation-contributor account that can submit an OpenAPI document), and UI:P means a victim must open the API reference page for the injected script to run. The vuln.today decision label is 'this_month' (not act_now/emergency), consistent with a non-KEV, non-mass-exploitation issue. No EPSS score was provided, this CVE is NOT in CISA KEV (no confirmed active exploitation), and the GHSA advisory includes a reproduction script, so a public PoC reference exists although it is not verified as packaged working exploit code. The flaw is also conditional on application design: it only bites deployments that embed attacker-controlled OpenAPI content into the server-side ScalarConfig.content or sources and that permit inline scripts. Net: a legitimate but bounded priority - patch within a normal cycle; it is not a drop-everything network-unauthenticated RCE. |
| Exploit ScenarioDerived | An attacker with contributor-level access to an application that renders a scalar-ninja (Django Ninja) API reference submits an OpenAPI document whose info.title (or any content/sources field) contains a '</script><script>...</script>' sequence. Because get_scalar_api_reference() embeds the JSON-serialized config inside an inline <script> without neutralizing the HTML </script> token, the browser of any user who later opens the documentation page parses the injected tag as a new script and runs attacker JavaScript in the documentation origin. A public PoC reproduction script exists in the GHSA advisory; it is not verified as working exploit code. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 17, 2026
Stored cross-site scripting in scalar-ninja 0.1.0 through 0.3.1 (the Django Ninja integration that renders Scalar API reference pages) allows an authenticated low-privileged documentation contributor to place a crafted OpenAPI document into ScalarConfig.content or sources[].content, which get_scalar_api_reference() then embeds unescaped inside an inline <script> element, so a visitor who opens the reference page has attacker-controlled JavaScript executed in the documentation origin. The flaw carries a CVSS 4.0 base score of 5.1 (medium); it is not listed in CISA KEV and no confirmed active exploitation was reported, though the vendor advisory ships a proof-of-concept reproduction that is not independently verified as working exploit code. Exploitation is constrained: the hosting application must pass untrusted OpenAPI content into the server-side configuration and the rendered page must permit inline scripts, and a victim must view the page.
RemediationAI
Vendor-released patch: scalar-ninja 0.3.3 (upgrade with pip install --upgrade scalar-ninja, or pin to >=0.3.3); the fix is PR #10934 / commit 0d5c2546e858e352d5d738b75c555a098a6b1264, which escapes '<' as \u003c in the inline configuration JSON and HTML-escapes the page title - see https://github.com/scalar/scalar/security/advisories/GHSA-8p3f-3g49-2935 and https://pypi.org/project/scalar-ninja/0.3.3/. Until upgrade is possible, apply the following compensating controls with their trade-offs: never pass untrusted or contributor-supplied OpenAPI documents into ScalarConfig.content or ScalarConfig.sources[].content - fetch the specification from a trusted, application-owned source or serve it through openapi_url instead, which removes the injectable sink entirely but means the docs page cannot display tenant- or user-submitted specifications; gate document submission to fully trusted operators rather than standard documentation contributors, which removes the low-privilege attack path but reduces self-service functionality; and serve the reference page with a Content-Security-Policy that does not permit arbitrary inline script execution (e.g. nonce- or hash-based allowance for the configuration script only), which stops the injected element from running but breaks the page if the CSP is applied as a blanket inline-script block, since the configuration itself is inline; note the advisory also requires the victim to open the page, so restricting who can reach the documentation endpoint reduces exposure only where nonce/hash CSP is not already in place. The same update should be applied to scalar-fastapi deployments that share the affected rendering code.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
scalar-ninja builds the HTML for a Scalar API reference page server-side in integrations/django-ninja/scalar_ninja/scalar_ninja.py; get_scalar_api_reference() assembles a js_config dictionary that includes ScalarConfig.content verbatim, or the sources branch through OpenAPISource.model_dump(), and then interpolates json.dumps(js_config) directly into a <script> block calling Scalar.createApiReference(). The root cause (CWE-79, cross-site scripting) is a context-confusion error: JSON string escaping is correct for JavaScript but does not neutralize the HTML tokenizer, which terminates a script data block at the first case-insensitive </script> sequence. A document containing </script><script>...</script> therefore closes the configuration script early and causes the browser to parse the remainder as a fresh, attacker-controlled script element executing in the documentation origin. The same commit also fixed an unescaped page <title> sink, which used raw ScalarConfig.title. The upstream fix (PR #10934, commit 0d5c2546e858e352d5d738b75c555a098a6b1264, merged 9 November 2026) serializes inline configuration through a helper that replaces '<' with the \u003c escape so no HTML token can alter the script context, and HTML-escapes the title with django.utils.html.escape.
Know when Django gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
An authenticated contributor (PR:L) injects stored XSS that requires a victim to view the page (UI:R); the script runs with the victim's browser authority (S:C) with limited read/modify impact (C:L/I:L).
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
Scalar scalar-ninja 0.1.0 before 0.3.3 contains a cross-site scripting vulnerability in get_scalar_api_reference() that embeds unescaped OpenAPI content inside an inline script element. Attackers can supply an OpenAPI document containing a </script><script> sequence in content or sources to execute scripts in the documentation origin for every user viewing the API reference.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
The package python/cpython from 0 and before 3.6.13, from 3.7.0 and before 3.7.10, from 3.8.0 and before 3.8.8, from 3.9
In Django 1.10.x before 1.10.8 and 1.11.x before 1.11.5, HTML autoescaping was disabled in a portion of the template for
An issue was discovered in Django 3.2 before 3.2.14 and 4.0 before 4.0.6. Rated critical severity (CVSS 9.8), this vulne
Django 3.1.x before 3.1.13 and 3.2.x before 3.2.5 allows QuerySet.order_by SQL injection if order_by is untrusted input
Django before 1.11.27, 2.x before 2.2.9, and 3.x before 3.0.1 allows account takeover. Rated critical severity (CVSS 9.8
An authentication/authorization bypass in the djust Python live-view framework (versions prior to 1.0.7) lets unauthenti
Unauthenticated arbitrary Python module import in djust before 1.0.7 lets any client that can reach the WebSocket or SSE
Django 1.11 before 1.11.29, 2.2 before 2.2.11, and 3.0 before 3.0.4 allows SQL Injection if untrusted data is used as a
Cross-site scripting (XSS) vulnerability in the dismissChangeRelatedObjectPopup function in contrib/admin/static/admin/j
Forged content modification in django-page-cms through 2.0.13 lets unauthenticated remote attackers exploit five CSRF-ex
Cross-site request forgery in djust's Server-Sent-Events transport affects all versions prior to 1.0.7 and allows a cros
Unauthenticated remote attackers can read live Django view and session state and invoke server-side handlers through dju
EUVD-2026-127011
GHSA-qcqh-p9f6-q4wm
NVD
CVE.org
EPSS
Exploit-DB