`\n\n"}},{"@type":"Question","name":"How severe is CVE-2026-33331?","acceptedAnswer":{"@type":"Answer","text":"CVE-2026-33331 has a CVSS score of 8.2/10, rated HIGH. Immediate patching is strongly recommended."}},{"@type":"Question","name":"Which packages are affected by CVE-2026-33331?","acceptedAnswer":{"@type":"Answer","text":"CVE-2026-33331 affects the following packages: @orpc/openapi (npm). Ecosystems affected: npm."}},{"@type":"Question","name":"How do I fix CVE-2026-33331?","acceptedAnswer":{"@type":"Answer","text":"Update @orpc/openapi to 1.13.9 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-33331 is resolved across your whole dependency graph."}},{"@type":"Question","name":"How do I detect CVE-2026-33331 in my npm dependencies?","acceptedAnswer":{"@type":"Answer","text":"Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @orpc/openapi, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version."}},{"@type":"Question","name":"How do I mitigate CVE-2026-33331 if there is no patch (or I can't update yet)?","acceptedAnswer":{"@type":"Answer","text":"If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands."}},{"@type":"Question","name":"How does O3 Security protect against CVE-2026-33331?","acceptedAnswer":{"@type":"Answer","text":"O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-33331 can be triaged on real exposure rather than presence alone."}},{"@type":"Question","name":"Is CVE-2026-33331 actively exploited in the wild?","acceptedAnswer":{"@type":"Answer","text":"No public exploit code has been indexed for CVE-2026-33331 yet. This does not mean the vulnerability cannot be exploited — absence of public exploits does not imply safety. Apply the recommended fix and use O3 Security to monitor your exposure."}},{"@type":"Question","name":"What is the EPSS score for CVE-2026-33331?","acceptedAnswer":{"@type":"Answer","text":"CVE-2026-33331 has an EPSS (Exploit Prediction Scoring System) score of 0.3%, placing it in the 25th percentile of all CVEs. EPSS is maintained by FIRST.org and estimates the probability that a vulnerability will be exploited in the wild within the next 30 days. This score indicates relatively lower exploitation probability, though the CVSS severity should still guide your patching priority."}},{"@type":"Question","name":"What type of vulnerability is CVE-2026-33331?","acceptedAnswer":{"@type":"Answer","text":"CVE-2026-33331 is classified as Cross-site Scripting (XSS) (CWE-79). This weakness type describe the underlying flaw category, which helps determine the potential impact and the right class of mitigation. This is a high-impact weakness class that often enables remote code execution or data exposure."}},{"@type":"Question","name":"When was CVE-2026-33331 published, and has it been updated?","acceptedAnswer":{"@type":"Answer","text":"CVE-2026-33331 was published on March 24, 2026 and was last updated on August 12, 2026. Advisory data evolves as severity scores, affected ranges, and exploit intelligence are revised — always check the latest version of the advisory before acting."}}]}
Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
HIGH severity

CVE-2026-33331 — @orpc/openapi

HIGHFix: middleapi/orpc@4f0efa8

CVE-2026-33331 is a high-severity (CVSS 8.2) Cross-site Scripting (XSS) vulnerability in @orpc/openapi. A fix is available for @orpc/openapi — see the affected versions and patch details below.

oRPC: Stored XSS in OpenAPI Reference Plugin via unescaped JSON.stringify

Also known asGHSA-7f6v-3gx7-27q8
Published
Mar 24, 2026
Updated
Aug 12, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Sep 24, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.

Exploitation and automatability from CISA’s SSVC triage for CVE-2026-33331.

EPSS Exploitation Probability

via FIRST.org ↗
0.3%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs25th percentile — riskier than 25% of all scored CVEsHighest risk

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

How urgent is this, really

CVE-2026-33331 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.

Where this sits among everything scored

Of 378,567 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

47other npm packages depend on this — each one inherits the vulnerability until it's patched upstream
@orpc/openapinpm
751Kdownloads / week

Description

A Stored Cross-Site Scripting (XSS) vulnerability exists in the OpenAPI documentation generation of orpc. If an attacker can control any field within the OpenAPI specification (such as info.description), they can break out of the JSON context and execute arbitrary JavaScript when a user views the generated API documentation. In the packages/openapi/src/plugins/openapi-reference.ts file, the renderDocsHtml() function takes an OpenAPI spec object and embeds it directly into the HTML response using a template literal:

<script id="spec" type="application/json">${JSON.stringify(spec)}</script>

The JSON.stringify() function does not escape HTML characters like < or >. Therefore, if an attacker provides a string containing </script><script>..., the browser will prematurely close the application/json script block and execute the subsequent malicious script block.

Proof of Concept (PoC)

  1. Create an API router with orpc and configure the OpenAPI plugin.
  2. In the API specification, inject a malicious payload into a field like description:
{
info: {
title: "My API",
version: "1.0.0",
description: "</script><script>alert('XSS executed on ' + document.domain)</script>"
}
}
  1. Generate and serve the documentation HTML.
  2. When a developer or user navigates to the API documentation URL, the browser parses the HTML, breaks out of the JSON block, and immediately executes the alert() payload.

Impact

If an application generates its OpenAPI specifications dynamically based on user-controlled inputs (or if a rogue developer modifies the spec), it leads to Stored XSS. When an administrator or developer views the API docs, the script executes in their browser, potentially leading to session hijacking or unauthorized API calls on their behalf.

Remediation

Do not use raw JSON.stringify() to embed data directly into HTML templates. Instead, safely serialize the JSON by escaping HTML-sensitive characters (like < and >) or use a secure HTML serialization library (such as serialize-javascript or devalue) before embedding it into the <script> tag.

Disclosure & Credits

If this report is helpful, I kindly request that you publish this as a formal GitHub Security Advisory and assign me credit for the discovery. Thank you for maintaining this project!

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npm@orpc/openapiall versions1.13.9npm install @orpc/openapi@1.13.9

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @orpc/openapi, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update @orpc/openapi to 1.13.9 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-33331 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-33331 can be triaged on real exposure rather than presence alone.

Tailored to CVE-2026-33331. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

A Stored Cross-Site Scripting (XSS) vulnerability exists in the OpenAPI documentation generation of orpc. If an attacker can control any field within the OpenAPI specification (such as info.description), they can break out of the JSON context and execute arbitrary JavaScript when a user views the generated API documentation. In the packages/openapi/src/plugins/openapi-reference.ts file, the renderDocsHtml() function takes an OpenAPI spec object and embeds it directly into the HTML response using a template literal: `<script id="spec" type="application/json">${JSON.stringify(spec)}</script>`
O3 Security · Impact-Aware SCA

Is CVE-2026-33331 in your dependencies?

O3 Security finds CVE-2026-33331 across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

CVE-2026-33331: @orpc/openapi (High 8.2) | O3 Security