Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply crafted title via app metadata
-
DeliveryApplication stores value in ScalarConfig.title
-
ExploitVisitor opens API Reference page
-
ExecutionBrowser parses injected </title><script>
-
ImpactExecute JavaScript 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 two specific conditions, both present in affected scalar-ninja versions 0.1.0 through 0.3.1 (fixed in 0.3.3): (1) the deploying application must copy attacker-controlled metadata into the server-side title passed to ScalarConfig(title=...) or ScalarViewer(title=...), because ScalarViewer.render_page()/get_scalar_api_reference() in integrations/django-ninja/scalar_ninja/scalar_ninja.py inserts config.title directly into the <title> element without HTML-text escaping; and (2) a victim must open the resulting API Reference documentation page, at which point </title> closes the title element and the following <script> executes. Limiting factors: this is NOT a default-configuration remote-unauthenticated flaw - it depends on the application deliberately feeding untrusted data into the title setting (a non-default/unsafe data flow), it requires victim interaction (loading the page, UI:P), and impact is confined to the documentation origin (read origin-accessible data and make same-origin requests via the visitor's browser). Applications that only set a static/trusted title are not exploitable. |
| Impact | This is a medium-severity stored/reflected cross-site scripting issue (CVSS 4.0 base 5.1) in the Scalar Django Ninja integration. The signals are mutually consistent and point to conditional, not opportunistic, risk. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:P) shows a network-reachable, low-complexity flaw but explicitly requires some privilege (PR:L) - an attacker must be able to place data into the server-side title metadata - and passive user interaction (UI:P), namely a visitor loading the API Reference page. The vuln.today decision label is 'this_month' (not act_now/emergency), aligning with the moderate score. No EPSS score is provided in the input, and the CVE is NOT in CISA KEV, so there is no evidence of active exploitation. A public PoC reference exists (a reproducer is published in the GHSA advisory), but it demonstrates the HTML/script-injection mechanism in a local harness and still depends on a deployment wiring attacker-controlled metadata into the title - it is not verified as a working drive-by exploit against default installs. Net: a legitimate issue to patch on a routine ('this month') cadence rather than an emergency, because exploitation is gated on a non-default data flow plus victim interaction, the impact is limited (VC:L/VI:L, no availability), and there is no KEV/EPSS signal indicating widespread exploitation. |
| Exploit ScenarioDerived | An application deploys scalar-ninja (0.1.0-0.3.1) and populates the API Reference page title from attacker-influenced metadata (for example a project/tenant name taken from user-supplied data). The attacker sets that title to a value beginning with </title><script>...</script>, and when any user opens the documentation page the browser closes the title element and executes the injected script in the documentation origin. A working PoC reproducer is published in the GHSA advisory, confirming the injection mechanism. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 17, 2026
Cross-site scripting in the Scalar Ninja integration for Django Ninja (pip package scalar-ninja) lets someone who can influence the configured documentation page title execute script in the documentation origin of every visitor who opens the API reference page. Versions 0.1.0 through 0.3.1 insert ScalarConfig.title / ScalarViewer(title=...) straight into the HTML <title> element, so a value beginning with </title> terminates the title element and the following <script> is parsed and executed; the assessed vector (CVSS 4.0 base 5.1, CVSS 3.1 AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N) reflects that low-privileged influence over metadata plus victim page interaction is required, and applications that hard-code a trusted static title are not exploitable. The issue is fixed in scalar-ninja 0.3.3, the upstream advisory publishes a proof-of-concept reproducer, and no active exploitation is confirmed at time of analysis.
RemediationAI
Upgrade scalar-ninja to 0.3.3 or later (https://pypi.org/project/scalar-ninja/0.3.3/), which is the vendor-released patch and corresponds to upstream commit 0d5c2546e858e352d5d738b75c555a098a6b1264; the fix HTML-escapes the configured title before it is written into the <title> element and additionally serializes the inlined Scalar config with '<' replaced by \u003c, so this upgrade also covers the script-context breakout variants for openapi_url, content, custom_css and sources. Because exploitation depends on an unsafe data flow rather than on defaults, deployments that cannot patch immediately should stop sourcing the title from untrusted metadata - hard-code a static trusted title, or HTML-escape the value with an HTML-text-context encoder before it reaches ScalarConfig/ScalarViewer - and treat metadata-fed titles as a security-relevant configuration change; this removes the entry condition but leaves the vulnerable rendering code in place, so it is a stopgap, not a substitute for the upgrade. Confirm the fix by verifying that rendered API reference pages contain an escaped title and that the inline initializer contains no raw '<' characters, as the upstream regression tests assert. See the vendor advisory at https://github.com/scalar/scalar/security/advisories/GHSA-p42g-h3g9-2m3c and the commit diff for details; per the vendor, patching the title and escaping the embedded configuration is the complete fix.
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 is the Python/Django Ninja binding for the Scalar API reference UI. In scalar_ninja/scalar_ninja.py, ScalarViewer.render_page() calls get_scalar_api_reference(config), which builds an HTML string returned in a Django HttpResponse. The template interpolated the configured title directly, as in {f"<title>{config.title if config.title else 'Scalar'}</title>"}; the surrounding code applied escape(..., quote=True) to resource URL attributes but never encoded config.title for the HTML text context. Because HTML parsers treat the contents of <title> as RCDATA, the only thing that ends the element is a literal </title> sequence, so a title beginning with that token closes the element and the following <script> markup is parsed as an executable element in the document head - classic CWE-79 improper neutralization of input during web page generation, here crossing from server-side configuration metadata into page markup. Commit 0d5c2546e858e352d5d738b75c555a098a6b1264 fixes it by assigning page_title = escape(config.title) before rendering and by adding _inline_script_json(), which serializes the embedded config with json.dumps and then replaces '<' with \u003c so JSON strings cannot break out of the inline initializer script; the accompanying tests parametrize break-out payloads such as </title><script>…</script><title>, </ScRiPt> case variants, and comment-tokenizer payloads against both the dictionary and JSON content paths. The changeset also patches scalar-fastapi, where the same '<' escaping is applied to embedded API descriptions. Root cause class per the CWE mapping is CWE-79; the practical lesson is that contextual output encoding was missing for the HTML text context even though attribute contexts were handled.
Know when Scalar Ninja 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
XSS executes in the visitor's browser origin so S:C; attacker must control the server-side title metadata (PR:L) and a visitor must load the page (UI:R); limited C/I, no availability impact.
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 that allows attackers to inject scripts by supplying unescaped ScalarConfig title values. Attackers controlling title metadata can close the title element with </title> and inject a script tag that executes in the documentation origin for API reference visitors.
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.
EUVD-2026-127010
GHSA-2qfj-gcwx-47pc
NVD
CVE.org
EPSS
Exploit-DB