Technical impact
Scalar scalar‑ninja versions 0.1.0 through 0.3.2 embed unescaped OpenAPI content inside an inline <script> element via the get_scalar_api_reference() function. An attacker can supply an OpenAPI document that includes a </script><script> sequence in its content or source fields, causing the browser to terminate the current script and execute the attacker‑supplied script while the page is rendered. This allows the execution of arbitrary JavaScript within the API reference page, giving the attacker the same origin privileges as the viewing user. The flaw is a classic reflected Cross‑Site Scripting (CWE‑79) that can lead to credential theft, session hijacking, or defacement for all users who load the vulnerable API reference.
Affected Systems
The vulnerability affects the Scalar scalar‑ninja package in the Scalar vendor. All releases from version 0.1.0 up to (but not including) 0.3.3 are impacted. Users running any of these versions are exposed unless they are restricted from inputting malicious OpenAPI documents.
Risk and Exploitability
The CVSS rating of 5.1 indicates the flaw is moderate in complexity but relies on the user visiting the vulnerable API reference page. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog, suggesting a lower likelihood of widespread exploitation at this time. Exploitation requires the ability to provide a crafted OpenAPI document to the system; no special privileges or advanced attack skills are needed beyond supplying that content. Asset owners should assume the flaw is usable by anyone who can influence the OpenAPI input that the scalar‑ninja service consumes and could impact all users browsing the documentation.