# CVE-2026-33331: oRPC: Stored XSS in OpenAPI Reference Plugin via unescaped JSON.stringify

> Attackers can execute arbitrary JavaScript in users' browsers by injecting malicious code into OpenAPI specification fields viewed in the documentation.

- **Severity:** High 8.2 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 24 Mar 2026
- **Updated:** 25 Mar 2026
- **Also known as:** GHSA-7f6v-3gx7-27q8

## What is CVE-2026-33331?

CVE-2026-33331 is a high-severity cross-site scripting vulnerability in middleapi orpc, published on 24 Mar 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

oRPC is an tool that helps build APIs that are end-to-end type-safe and adhere to OpenAPI standards. Prior to version 1.13.9, 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. This issue has been patched in version 1.13.9.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2026-33331?

2 open source packages ship an affected version, including @orpc/openapi. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@orpc/openapi` | npm | All versions | 1.13.9 |
| `@orpc/openapi` | npm | All versions | 1.13.9 |

Products: Orpc Orpc.

## How do I fix CVE-2026-33331?

Upgrade @orpc/openapi to 1.13.9 or later.

## Is CVE-2026-33331 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-33331 exists.

Public exploit code:

- Proof-of-concept lab for stored XSS in orpc (CVE-2026-33331) (github_poc): https://github.com/abhayclasher/CVE-2026-33331

## Other vulnerabilities in middleapi orpc

- [CVE-2026-28794](https://insights.sbomify.com/CVE-2026-28794/): oRPC: Prototype Pollution in `@orpc/client` via `StandardRPCJsonSerializer` Deserialization (critical 9.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-33331 and fix it if it is affected.

What it is: CVE-2026-33331 is a high-severity cross-site scripting vulnerability in middleapi orpc, published on 24 Mar 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-33331 exists.

Affected packages and fixed versions:
- @orpc/openapi (npm): affected all versions; fixed in 1.13.9
- @orpc/openapi (npm): affected all versions; fixed in 1.13.9

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-33331/ (Markdown: https://insights.sbomify.com/CVE-2026-33331/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-33331
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-33331
- OSV: https://osv.dev/vulnerability/CVE-2026-33331

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-33331/
Summaries are generated and may contain mistakes; the official description above is the record.
