Vulnerabilities in pkg:npm/@tdurieux/anonymous_github
PACKAGEGHSA-g485-8j3v-p6x8 is a HIGH (CVSS 8.1) cross-site scripting vulnerability (CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)) affecting @tdurieux/anonymous github libraries in the npm ecosystem. The issue involves @tdurieux/anonymous_github vulnerable to xss via unsanitized github repository content rendering in anonymous github origin. Remediation is available by upgrading affected packages to version 2.3.0.
pkg:npm/@tdurieux/anonymous_github
Vulnerability advisories affecting package pkg:npm/@tdurieux/anonymous_github. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-g485-8j3v-p6x8 | - | HIGH | @tdurieux/anonymous_github Vulnerable to XSS via Unsanitized GitHub Repository Content Rendering in Anonymous GitHub Origin |
GHSA-g485-8j3v-p6x8 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N).
How to Fix GHSA-g485-8j3v-p6x8
To remediate this vulnerability, upgrade all affected @tdurieux/anonymous github dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @tdurieux/anonymous_github@2.3.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @tdurieux/anonymous_github
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-g485-8j3v-p6x8, inspect your project dependencies using npm:
npm ls @tdurieux/anonymous_github
Analyze the terminal output to locate any version of @tdurieux/anonymous github in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.0), your application is affected.
Note: The npm ls @tdurieux/anonymous_github command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages. In @tdurieux/anonymous github, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-g485-8j3v-p6x8 Affected @tdurieux/anonymous github Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@tdurieux/anonymous_github
|
npm |
≥ 2.2.0
< 2.3.0
All 1 versions
2.2.0
|
2.3.0
|
References
Frequently Asked Questions
What is GHSA-g485-8j3v-p6x8?
Which @tdurieux/anonymous github versions are affected?
What version fixes GHSA-g485-8j3v-p6x8?
Is @tdurieux/anonymous_github affected?
What is the CVSS score of GHSA-g485-8j3v-p6x8?
What CWE is associated with GHSA-g485-8j3v-p6x8?
How can I check npm dependencies for GHSA-g485-8j3v-p6x8?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-g485-8j3v-p6x8",
"modified" : "2026-05-05T18:28:32Z",
"published" : "2026-05-05T18:28:32Z",
"aliases" : [ ],
"summary" : "@tdurieux/anonymous_github Vulnerable to XSS via Unsanitized GitHub Repository Content Rendering in Anonymous GitHub Origin",
"details" : "### Summary\n\nAnonymous GitHub fetches repository content (e.g., markdown files) from GitHub's API and renders it without sanitization. On the client side, markdown is parsed with `marked` (with `sanitize: false`) and injected into the DOM via `$sce.trustAsHtml()` + `ng-bind-html`, bypassing AngularJS's built-in XSS protection. An attacker can craft a malicious GitHub repository whose README executes arbitrary JavaScript in the Anonymous GitHub origin.\n\n### Details\n\n#### README fetched from GitHub API\n\nThe server fetches the README via GitHub's REST API and stores the raw markdown in MongoDB:\n\n```typescript\n// https://github.com/tdurieux/anonymous_github/blob/b2d77faa6c6f35ad9ae6ed46e3a3fa4681ac84c2/src/core/source/GitHubRepository.ts#L162-L174\nconst ghRes = await oct.repos.getReadme({\n owner: this.owner,\n repo: this.repo,\n ref: selected?.commit,\n});\nconst readme = Buffer.from(\n ghRes.data.content,\n ghRes.data.encoding as BufferEncoding\n).toString(\"utf-8\");\nselected.readme = readme;\nawait model.save();\n```\n\nIt is then served to the client with no sanitization:\n\n```typescript\n// https://github.com/tdurieux/anonymous_github/blob/b2d77faa6c6f35ad9ae6ed46e3a3fa4681ac84c2/src/server/routes/repository-private.ts#L254-L260\nreturn res.send(\n await repo.readme({\n accessToken: token,\n force: req.query.force == \"1\",\n branch: req.query.branch as string,\n })\n);\n```\n\n#### Client-side rendering via `$sce.trustAsHtml()` + `ng-bind-html`\n\nThe client fetches the raw README, parses it with `renderMD()` (which uses `marked` with `sanitize: false`), then bypasses AngularJS sanitization:\n\n```javascript\n// https://github.com/tdurieux/anonymous_github/blob/b2d77faa6c6f35ad9ae6ed46e3a3fa4681ac84c2/public/script/app.js#L1219-L1226\nconst res = await $http.get(`/api/repo/${o.owner}/${o.repo}/readme`, {\n params: { force: force === true ? \"1\" : \"0\", branch: $scope.source.branch },\n});\n$scope.readme = res.data;\n```\n\n```javascript\n// https://github.com/tdurieux/anonymous_github/blob/b2d77faa6c6f35ad9ae6ed46e3a3fa4681ac84c2/public/script/app.js#L1339-L1343\nconst html = renderMD(\n $scope.anonymize_readme,\n `https://github.com/${o.owner}/${o.repo}/raw/${$scope.source.branch}/`\n);\n$scope.html_readme = $sce.trustAsHtml(html); // sink: bypasses Angular XSS protection\n```\n\nThe `renderMD()` function explicitly disables sanitization:\n\n```javascript\n// https://github.com/tdurieux/anonymous_github/blob/b2d77faa6c6f35ad9ae6ed46e3a3fa4681ac84c2/public/script/utils.js#L165-L176\nmarked.setOptions({\n sanitize: false, // HTML in markdown is preserved as-is\n // ...\n});\nreturn marked.parse(md, { renderer });\n```\n\nThe resulting HTML is bound to the DOM via `ng-bind-html`, which trusts the string marked by `$sce.trustAsHtml()` and inserts it as innerHTML.\n\n### Impact\n\n1. **Stored XSS**: Any malicious GitHub repository can execute JavaScript in the Anonymous GitHub origin when a user anonymizes it or views its content\n2. **Account Takeover**: Steal authentication tokens and session cookies\n3. **Data Exfiltration**: Access other users' anonymization configurations and private repository data via `/api/user` and `/api/repo/list`\n\n### Proof of Concept\n\n\n\n1. Create a GitHub repository with a malicious `README.md`:\n\n```markdown\n# Innocent README\n<img src=x onerror=\"alert(document.domain)\">\n```\n\n2. On Anonymous GitHub, enter the malicious repository URL to anonymize it\n3. The XSS executes immediately when the README preview is rendered on the anonymize page\n\n### Remediation\n\n1. Sanitize markdown output with DOMPurify before rendering (the dependency already exists but is unused)\n2. Serve HTML files with `Content-Disposition: attachment` or in a sandboxed iframe on a separate origin\n3. Replace `$sce.trustAsHtml()` with proper `ngSanitize` usage\n4. HTML-escape filenames and paths in directory listing templates\n5. Add Content Security Policy headers\n\n### Credits\n\nZhengyu Liu, Jingcheng Yang",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@tdurieux/anonymous_github"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.2.0"
}, {
"fixed" : "2.3.0"
} ]
} ],
"versions" : [ "2.2.0" ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/tdurieux/anonymous_github/security/advisories/GHSA-g485-8j3v-p6x8"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/tdurieux/anonymous_github"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79", "CWE-80" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-05T18:28:32Z",
"nvd_published_at" : null
}
}