Executive brief
GuardDog, a tool used to scan software projects for malicious packages, contains a flaw in how it handles remote repository URLs. An attacker can provide a specially crafted URL that tricks the scanner into sending the user's private GitHub access tokens to a server controlled by the attacker. This could lead to the theft of sensitive credentials and unauthorized access to private code repositories.
Technical details
A vulnerability exists in `ProjectScanner.scan_remote()` where repository URLs are modified using a simple string replacement (`url.replace("github", "raw.githubusercontent")`) without proper hostname validation. An attacker can supply a crafted URL, such as one using the 'userinfo' field (e.g., `http://github@attacker-controlled-ip`), which bypasses the intended logic and redirects the request to an arbitrary destination. Because GuardDog automatically attaches the `GH_TOKEN` via HTTP Basic Auth to these requests, the attacker can capture the credentials and perform SSRF against internal services reachable by the scanner. The issue is located in `guarddog/scanners/scanner.py` and affects versions up to 2.9.0.
Affected products
- DataDog guarddog >= 1.0.0, <= 2.9.0
Timeline
- 2026-03-18: other: Internal discovery/check date
- 2026-05-06: disclosed: Initial disclosure to vendor
- 2026-05-11: advisory: GitHub Advisory published
- 2026-05-27: other: NVD publication date