Skip to main content

scalar-ninja EUVDEUVD-2026-127011

| CVE-2026-130593 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-11-17 VulnCheck GHSA-qcqh-p9f6-q4wm
5.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Authenticate as documentation contributor
  2. Delivery
    Submit OpenAPI doc containing </script><script> payload
  3. Exploit
    Content embedded unescaped in inline config script
  4. Execution
    Victim opens API reference page
  5. Impact
    Injected 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.

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

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

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

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

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).

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

EPSS Score
0.3%
Top 77% exploitable
Prevalence
Low
niche Python package; Django Ninja integration for Scalar API docs
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.

More in Django

View all
CVE-2021-23336 MEDIUM POC
5.9 Feb 15

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

CVE-2017-12794 MEDIUM POC
6.1 Sep 07

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

CVE-2022-34265 CRITICAL POC
9.8 Jul 04

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

CVE-2021-35042 CRITICAL POC
9.8 Jul 02

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

CVE-2019-19844 CRITICAL POC
9.8 Dec 18

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

CVE-2026-61594 CRITICAL POC
9.1 Sep 16

An authentication/authorization bypass in the djust Python live-view framework (versions prior to 1.0.7) lets unauthenti

CVE-2026-61599 HIGH POC
8.8 Sep 16

Unauthenticated arbitrary Python module import in djust before 1.0.7 lets any client that can reach the WebSocket or SSE

CVE-2020-9402 HIGH POC
8.8 Mar 05

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

CVE-2016-6186 MEDIUM POC
6.1 Aug 05

Cross-site scripting (XSS) vulnerability in the dismissChangeRelatedObjectPopup function in contrib/admin/static/admin/j

CVE-2026-93456 HIGH POC
8.4 Sep 18

Forged content modification in django-page-cms through 2.0.13 lets unauthenticated remote attackers exploit five CSRF-ex

CVE-2026-61593 HIGH POC
8.1 Sep 16

Cross-site request forgery in djust's Server-Sent-Events transport affects all versions prior to 1.0.7 and allows a cros

CVE-2026-61590 HIGH POC
7.4 Sep 16

Unauthenticated remote attackers can read live Django view and session state and invoke server-side handlers through dju

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