GHSA-7f6v-3gx7-27q8

Suggest an improvement
Source
https://github.com/advisories/GHSA-7f6v-3gx7-27q8
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-7f6v-3gx7-27q8/GHSA-7f6v-3gx7-27q8.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-7f6v-3gx7-27q8
Aliases
Published
2026-03-20T17:25:56Z
Modified
2026-03-27T22:16:26Z
Severity
  • 8.2 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N CVSS Calculator
Summary
oRPC has Stored XSS in OpenAPI Reference Plugin via unescaped JSON.stringify
Details

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

Database specific
{
    "cwe_ids":  [
        "CWE-79"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-03-20T17:25:56Z",
    "nvd_published_at":  "2026-03-24T20:16:28Z",
    "severity":  "HIGH"
}
References

Affected packages

npm / @orpc/openapi

Package

Name
@orpc/openapi
View open source insights on deps.dev
Purl
pkg:npm/%40orpc/openapi

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.13.9

Database specific

last_known_affected_version_range
"<= 1.13.8"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-7f6v-3gx7-27q8/GHSA-7f6v-3gx7-27q8.json"