Skip to main content

Scalar Ninja CVE-2026-130594

| EUVDEUVD-2026-127010 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-11-17 VulnCheck GHSA-2qfj-gcwx-47pc
5.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Supply crafted title via app metadata
  2. Delivery
    Application stores value in ScalarConfig.title
  3. Exploit
    Visitor opens API Reference page
  4. Execution
    Browser parses injected </title><script>
  5. Impact
    Execute 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

scalar-ninja 0.1.0 <0.3.3

Affected Packages

euvd scalar_ninja fix: 0.3.3

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

Vendor (VulnCheck) PRIMARY 5.1 MEDIUM
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
vuln.today AI 5.4 MEDIUM

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.

3.1 AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

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

EPSS Score
0.3%
Top 77% exploitable
Prevalence
Low
niche Python API-docs integration (Django Ninja/FastAPI), limited deployment footprint
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy