{"id":"CVE-2026-44220","aliases":["CVE-2026-44220","GHSA-8cxw-cc62-q28v","PYSEC-2026-2408"],"related":[],"kind":"vulnerability","state":"published","title":"ciguard: discover_pipeline_files follows symlinks out of scan root","summary":"ciguard is a static security auditor for CI/CD pipelines. From 0.8.0 to 0.8.1 , the discover_pipeline_files() function in src/ciguard/discovery.py 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. This vulnerability is fixed in 0.8.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"ciguard is a static security auditor for CI/CD pipelines. From 0.8.0 to 0.8.1 , the discover_pipeline_files() function in src/ciguard/discovery.py 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. This vulnerability is fixed in 0.8.2.","source":"cvelist"},{"lang":"en","text":"## 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's 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` — 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` — first.org calc 5.7 (Medium); GitHub's calc returns 2.4 (Low). Vector is correct — 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 -> /etc\n# (or any other accessible dir containing pipeline-shaped files)\nfor f in discover_pipeline_files(Path('/tmp/victim')):\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) — same conceptual pattern (path-validation flaw in an AI-agent tool) in Claude SDK for Python, CWE-59 + CWE-367","format":"markdown","source":"ghsa"},{"lang":"es","text":"ciguard es un auditor de seguridad estático para pipelines de CI/CD. De 0.8.0 a 0.8.1, la función discover_pipeline_files() en src/ciguard/discovery.py recorre un árbol de directorios siguiendo enlaces simbólicos, con protección contra ciclos mediante el seguimiento de rutas resueltas visitadas. Un atacante que puede plantar un enlace simbólico en un directorio que el usuario (o agente de IA) escanea puede hacer que el descubrimiento entre en el destino del enlace simbólico y devuelva rutas a archivos con formato de pipeline fuera de la raíz solicitada. Esta vulnerabilidad está corregida en 0.8.2.","source":"nvd"}],"published":"2026-05-05T22:19:23.000Z","modified":"2026-10-26T18:10:00.173Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N","score":3.2,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N","score":3.2,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N","score":0,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"LOW"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N","score":0,"rating":"NONE"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"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"}],"cwes":["CWE-59"],"affected":[{"ranges":[{"version":">= 0.8.0, < 0.8.2","status":"affected"}],"vendor":"Jo-Jo98","product":"ciguard","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0.8.0","status":"affected","fixed":"0.8.2"}],"ecosystem":"PyPI","package":"ciguard","purl":"pkg:pypi/ciguard","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0.8.0","status":"affected","fixed":"0.8.2"}],"ecosystem":"PyPI","package":"ciguard","purl":"pkg:pypi/ciguard","source":"pysec"}],"references":[{"url":"https://github.com/Jo-Jo98/ciguard/security/advisories/GHSA-8cxw-cc62-q28v","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44220","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/Jo-Jo98/ciguard","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/Jo-Jo98/ciguard/releases/tag/v0.8.2","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/Jo-Jo98/ciguard/releases/tag/v0.8.3","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/ciguard","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-8cxw-cc62-q28v","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-05-13T14:58:20.667Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-44220","url":"https://www.cve.org/CVERecord?id=CVE-2026-44220","licence":"CVE Terms of Use","modified":"2026-05-13T15:37:35.696Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8cxw-cc62-q28v","url":"https://github.com/advisories/GHSA-8cxw-cc62-q28v","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:33.711Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-44220","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44220","licence":"Public domain","modified":"2026-10-26T18:10:00.173Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2408","url":"https://osv.dev/vulnerability/PYSEC-2026-2408","licence":"CC-BY-4.0","modified":"2026-07-13T16:32:11.271Z"}],"updatedAt":"2026-11-25T22:59:21.485Z","epss":{"score":0.00214,"percentile":0.12477,"date":"2026-12-01T12:00:22.000Z"}}