GHSA-8CXW-CC62-Q28V
Vulnerability from github – Published: 2026-05-05 22:19 – Updated: 2026-05-15 23:51Summary
The discover_pipeline_files() function in src/ciguard/discovery.py (introduced in v0.8.0 and used by the MCP scan_repo tool shipped in v0.8.1) walks a directory tree following symlinks, with cycle protection via tracking visited resolved paths. An attacker who can plant a symlink in a directory the user (or AI agent) scans can cause discovery to walk into the symlink target and return paths to pipeline-shaped files outside the requested root.
Threat scenario
MCP confused-deputy. A user runs Claude Desktop / Claude Code / Cursor with the ciguard MCP server registered. The agent is fed an adversarial prompt to scan a directory containing planted symlinks (e.g. via a malicious clone or extracted tarball). ciguard.scan_repo walks the symlinks, returning paths and (via subsequent scan calls) file content from ~/.aws/, ~/.config/, /etc/some-pipeline-config/, etc. Pipeline files often contain hardcoded secrets, internal hostnames, deploy keys.
Patch
- New
follow_symlinks: bool = Falseparameter ondiscover_pipeline_files. Default refuses to descend into symlinked directories OR symlinked files. - Belt-and-braces: results are filtered to those whose
.resolve()lies underroot.resolve(), applied even when callers opt in tofollow_symlinks=True. - 3 regression tests in
tests/test_discovery.py::TestSymlinkSafety.
Discovery
Found during ciguard's first self-conducted penetration test cycle (PTES + OWASP TG v4.2 + CREST framing), 2026-04-26.
CVSS Scoring
- CVSS v3.1:
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N— 4.4 (Medium) - CVSS v4.0:
CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N— first.org calc 5.7 (Medium); GitHub's calc returns 2.4 (Low). Vector is correct — calculator profiles differ.
Reproduction
from pathlib import Path
from ciguard.discovery import discover_pipeline_files
# In a victim dir, plant: trojan -> /etc
# (or any other accessible dir containing pipeline-shaped files)
for f in discover_pipeline_files(Path('/tmp/victim')):
print(f) # pre-fix: includes paths under /etc; post-fix: only /tmp/victim/
References
- Fix released in v0.8.2
- CI regression gate added in v0.8.3
- https://www.cve.org/CVERecord?id=CVE-2026-44220
See also: GHSA-w828-4qhx-vxx3 — same conceptual pattern (path-validation flaw in an AI-agent tool) in Claude SDK for Python, CWE-59 + CWE-367
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.8.1"
},
"package": {
"ecosystem": "PyPI",
"name": "ciguard"
},
"ranges": [
{
"events": [
{
"introduced": "0.8.0"
},
{
"fixed": "0.8.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-44220"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": true,
"github_reviewed_at": "2026-05-05T22:19:23Z",
"nvd_published_at": "2026-05-12T20:16:42Z",
"severity": "LOW"
},
"details": "## Summary\n\nThe `discover_pipeline_files()` function in `src/ciguard/discovery.py` (introduced in v0.8.0 and used by the MCP `scan_repo` tool shipped in v0.8.1) walks a directory tree following symlinks, with cycle protection via tracking visited resolved paths. An attacker who can plant a symlink in a directory the user (or AI agent) scans can cause discovery to walk into the symlink target and return paths to pipeline-shaped files outside the requested root.\n\n## Threat scenario\n\n**MCP confused-deputy.** A user runs Claude Desktop / Claude Code / Cursor with the ciguard MCP server registered. The agent is fed an adversarial prompt to scan a directory containing planted symlinks (e.g. via a malicious clone or extracted tarball). `ciguard.scan_repo` walks the symlinks, returning paths and (via subsequent `scan` calls) file content from `~/.aws/`, `~/.config/`, `/etc/some-pipeline-config/`, etc. Pipeline files often contain hardcoded secrets, internal hostnames, deploy keys.\n\n## Patch\n\n- New `follow_symlinks: bool = False` parameter on `discover_pipeline_files`. Default refuses to descend into symlinked directories OR symlinked files.\n- Belt-and-braces: results are filtered to those whose `.resolve()` lies under `root.resolve()`, applied even when callers opt in to `follow_symlinks=True`.\n- 3 regression tests in `tests/test_discovery.py::TestSymlinkSafety`.\n\n## Discovery\n\nFound during ciguard\u0027s first self-conducted penetration test cycle (PTES + OWASP TG v4.2 + CREST framing), 2026-04-26.\n\n## CVSS Scoring\n\n- CVSS v3.1: `CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N` \u2014 4.4 (Medium)\n- CVSS v4.0: `CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N` \u2014 first.org calc 5.7 (Medium); GitHub\u0027s calc returns 2.4 (Low). Vector is correct \u2014 calculator profiles differ.\n\n## Reproduction\n\n```python\nfrom pathlib import Path\nfrom ciguard.discovery import discover_pipeline_files\n# In a victim dir, plant: trojan -\u003e /etc\n# (or any other accessible dir containing pipeline-shaped files)\nfor f in discover_pipeline_files(Path(\u0027/tmp/victim\u0027)):\n print(f) # pre-fix: includes paths under /etc; post-fix: only /tmp/victim/\n```\n\n## References\n\n- Fix released in [v0.8.2](https://github.com/Jo-Jo98/ciguard/releases/tag/v0.8.2)\n- CI regression gate added in [v0.8.3](https://github.com/Jo-Jo98/ciguard/releases/tag/v0.8.3)\n- https://www.cve.org/CVERecord?id=CVE-2026-44220\n\nSee also: [GHSA-w828-4qhx-vxx3](https://github.com/advisories/GHSA-w828-4qhx-vxx3) \u2014 same conceptual pattern (path-validation flaw in an AI-agent tool) in Claude SDK for Python, CWE-59 + CWE-367",
"id": "GHSA-8cxw-cc62-q28v",
"modified": "2026-05-15T23:51:39Z",
"published": "2026-05-05T22:19:23Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/Jo-Jo98/ciguard/security/advisories/GHSA-8cxw-cc62-q28v"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-44220"
},
{
"type": "PACKAGE",
"url": "https://github.com/Jo-Jo98/ciguard"
},
{
"type": "WEB",
"url": "https://github.com/Jo-Jo98/ciguard/releases/tag/v0.8.2"
},
{
"type": "WEB",
"url": "https://github.com/Jo-Jo98/ciguard/releases/tag/v0.8.3"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "ciguard: discover_pipeline_files follows symlinks out of scan root"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.