GHSA-g485-8j3v-p6x8: @tdurieux/anonymous_github Vulnerable to XSS via Unsanitized GitHub Repository Content Rendering in Anonymous GitHub Origin
Noroxi assessment
Priority: Monitor (action score 32/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Anyone who can reach it over the internet can trigger it. A low-privileged account is enough. No user action is required. No special conditions are required; it is repeatable.
- Fixed version: @tdurieux/anonymous_github (npm) 2.3.0.
Low priority for now. Upgrade to @tdurieux/anonymous_github (npm) 2.3.0 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: OSV
### Summary Anonymous 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. ### Details #### README fetched from GitHub API The server fetches the README via GitHub's REST API and stores the raw markdown in MongoDB: ```typescript // https://github.com/tdurieux/anonymous_github/blob/b2d77faa6c6f35ad9ae6ed46e3a3fa4681ac84c2/src/core/source/GitHubRepository.ts#L162-L174 const ghRes = await oct.repos.getReadme({ owner: this.owner, repo: this.repo, ref: selected?.commit, }); const readme = Buffer.from( ghRes.data.content, ghRes.data.encoding as BufferEncoding ).toString("utf-8"); selected.readme = readme; await model.save(); ``` It is then served to the client with no sanitization: ```typescript // https://github.com/tdurieux/anonymous_github/blob/b2d77faa6c6f35ad9ae6ed46e3a3fa4681ac84c2/src/server/routes/repository-private.ts#L254-L260 return res.send( await repo.readme({ accessToken: token, force: req.query.force == "1", branch: req.query.branch as string, }) ); ``` #### Client-side rendering via `$sce.trustAsHtml()` + `ng-bind-html` The client fetches the raw README, parses it with `renderMD()` (which uses `marked` with `sanitize: false`), then bypasses AngularJS sanitization: ```javascript // https://github.com/tdurieux/anonymous_github/blob/b2d77faa6c6f35ad9ae6ed46e3a3fa4681ac84c2/public/script/app.js#L1219-L1226 const res = await $http.get(`/api/repo/${o.owner}/${o.repo}/readme`, { params: { force: force === true ? "1" : "0", branch: $scope.source.branch }, }); $scope.readme = res.data; ``` ```javascript // https://github.com/tdurieux/anonymous_github/blob/b2d77faa6c6f35ad9ae6ed46e3a3fa4681ac84c2/public/script/app.js#L1339-L1343 const html = renderMD( $scope.anonymize_readme, `https://github.com/${o.owner}/${o.repo}/raw/${$scope.source.branch}/` ); $scope.html_readme = $sce.trustAsHtml(html); // sink: bypasses Angular XSS protection ``` The `renderMD()` function explicitly disables sanitization: ```javascript // https://github.com/tdurieux/anonymous_github/blob/b2d77faa6c6f35ad9ae6ed46e3a3fa4681ac84c2/public/script/utils.js#L165-L176 marked.setOptions({ sanitize: false, // HTML in markdown is preserved as-is // ... }); return marked.parse(md, { renderer }); ``` The resulting HTML is bound to the DOM via `ng-bind-html`, which trusts the string marked by `$sce.trustAsHtml()` and inserts it as innerHTML. ### Impact 1. **Stored XSS**: Any malicious GitHub repository can execute JavaScript in the Anonymous GitHub origin when a user anonymizes it or views its content 2. **Account Takeover**: Steal authentication tokens and session cookies 3. **Data Exfiltration**: Access other users' anonymization configurations and private repository data via `/api/user` and `/api/repo/list` ### Proof of Concept  1. Create a GitHub repository with a malicious `README.md`: ```markdown # Innocent README <img src=x onerror="alert(document.domain)"> ``` 2. On Anonymous GitHub, enter the malicious repository URL to anonymize it 3. The XSS executes immediately when the README preview is rendered on the anonymize page ### Remediation 1. Sanitize markdown output with DOMPurify before rendering (the dependency already exists but is unused) 2. Serve HTML files with `Content-Disposition: attachment` or in a sandboxed iframe on a separate origin 3. Replace `$sce.trustAsHtml()` with proper `ngSanitize` usage 4. HTML-escape filenames and paths in directory listing templates 5. Add Content Security Policy headers ### Credits Zhengyu Liu, Jingcheng Yang
- Published
- May 5, 2026
- Updated
- May 5, 2026
- EPSS
- —
- CWE
- CWE-79
Report tools
Action score
32
Low priority for now.
- CVSS
- 32 / 40 · 8.1 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · —
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Limit the impact of XSSCheck security headers
Is your version affected? Check itNoroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| npm | @tdurieux/anonymous_github | pkg:npm/%40tdurieux/anonymous_github |
Limit the impact of XSS
This is a cross-site scripting (XSS) vulnerability. A well-configured Content-Security-Policy doesn't fix it, but greatly reduces its impact. Check your site's CSP and other security headers for free.
Check security headersPackage-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| npm | @tdurieux/anonymous_github | from 2.2.0 · before 2.3.0 | 2.3.0 |
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| npm:@tdurieux/anonymous_github | 2.3.0 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
Not on record for this CVE: EPSS history · patch commit or PR link · researcher credit · variant or chain candidate · public bounty program.
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- A low-privileged account is enough.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- high · data can be read
- Integrity
- high · data or configuration can be modified
- Availability
- none
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- High
- Integrity impact
- High
- Availability impact
- None
Weakness class (CWE)
CWE-79 · Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
osv
Root cause
User content is inserted into the page as HTML. The browser interprets the content as code rather than data.
The bug in code
The whole CWE-79 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
commentEl.innerHTML = comment.body;Fixed
commentEl.textContent = comment.body;Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
ATT&CK techniques
—
Change log (1)
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (1 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.