Lookup for vulnerable packages by Package URL.

Purlpkg:npm/%40orpc/openapi@0.0.0-next.999d654
Typenpm
Namespace@orpc
Nameopenapi
Version0.0.0-next.999d654
Qualifiers
Subpath
Is_vulnerabletrue
Next_non_vulnerable_version1.13.9
Latest_non_vulnerable_version1.13.9
Affected_by_vulnerabilities
0
url VCID-dbqg-yxqr-aff3
vulnerability_id VCID-dbqg-yxqr-aff3
summary
oRPC has Stored XSS in OpenAPI Reference Plugin via unescaped JSON.stringify
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>"
}
}
```

3. Generate and serve the documentation HTML.
4. 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!
references
0
reference_url https://api.first.org/data/v1/epss?cve=CVE-2026-33331
reference_id
reference_type
scores
0
value 0.00018
scoring_system epss
scoring_elements 0.05094
published_at 2026-06-06T12:55:00Z
1
value 0.00018
scoring_system epss
scoring_elements 0.05089
published_at 2026-06-09T12:55:00Z
2
value 0.00018
scoring_system epss
scoring_elements 0.05047
published_at 2026-06-08T12:55:00Z
3
value 0.00018
scoring_system epss
scoring_elements 0.05088
published_at 2026-06-07T12:55:00Z
4
value 0.00018
scoring_system epss
scoring_elements 0.05109
published_at 2026-06-05T12:55:00Z
url https://api.first.org/data/v1/epss?cve=CVE-2026-33331
1
reference_url https://github.com/middleapi/orpc
reference_id
reference_type
scores
0
value 8.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N
1
value HIGH
scoring_system generic_textual
scoring_elements
url https://github.com/middleapi/orpc
2
reference_url https://github.com/middleapi/orpc/commit/4f0efa8a1d3fa8e8317a4b03cc3945a5dfd68add
reference_id
reference_type
scores
0
value 8.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N
1
value HIGH
scoring_system generic_textual
scoring_elements
2
value Track
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-03-25T13:34:21Z/
url https://github.com/middleapi/orpc/commit/4f0efa8a1d3fa8e8317a4b03cc3945a5dfd68add
3
reference_url https://github.com/middleapi/orpc/releases/tag/v1.13.9
reference_id
reference_type
scores
0
value 8.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N
1
value HIGH
scoring_system generic_textual
scoring_elements
2
value Track
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-03-25T13:34:21Z/
url https://github.com/middleapi/orpc/releases/tag/v1.13.9
4
reference_url https://github.com/middleapi/orpc/security/advisories/GHSA-7f6v-3gx7-27q8
reference_id
reference_type
scores
0
value 8.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N
1
value HIGH
scoring_system cvssv3.1_qr
scoring_elements
2
value HIGH
scoring_system generic_textual
scoring_elements
3
value Track
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-03-25T13:34:21Z/
url https://github.com/middleapi/orpc/security/advisories/GHSA-7f6v-3gx7-27q8
5
reference_url https://nvd.nist.gov/vuln/detail/CVE-2026-33331
reference_id
reference_type
scores
0
value 8.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N
1
value HIGH
scoring_system generic_textual
scoring_elements
url https://nvd.nist.gov/vuln/detail/CVE-2026-33331
6
reference_url https://github.com/advisories/GHSA-7f6v-3gx7-27q8
reference_id GHSA-7f6v-3gx7-27q8
reference_type
scores
0
value HIGH
scoring_system cvssv3.1_qr
scoring_elements
url https://github.com/advisories/GHSA-7f6v-3gx7-27q8
fixed_packages
0
url pkg:npm/%40orpc/openapi@1.13.9
purl pkg:npm/%40orpc/openapi@1.13.9
is_vulnerable false
affected_by_vulnerabilities
resource_url http://public2.vulnerablecode.io/packages/pkg:npm/%2540orpc/openapi@1.13.9
aliases CVE-2026-33331, GHSA-7f6v-3gx7-27q8
risk_score 4.0
exploitability 0.5
weighted_severity 8.0
resource_url http://public2.vulnerablecode.io/vulnerabilities/VCID-dbqg-yxqr-aff3
Fixing_vulnerabilities
Risk_score4.0
Resource_urlhttp://public2.vulnerablecode.io/packages/pkg:npm/%2540orpc/openapi@0.0.0-next.999d654