{"id":"CVE-2026-44972","aliases":["CVE-2026-44972","GHSA-m5p4-gvpx-4mvr","PYSEC-2026-2506"],"related":[],"kind":"vulnerability","state":"published","title":"GuardDog: Unsanitized human-readable scan output allows terminal escape injection from malicious package content","summary":"GuardDog is a CLI tool to identify malicious PyPI packages. From 2.6.0 to 2.9.0, GuardDog includes attacker-controlled filenames, file locations, messages, and code snippets in its default human-readable output without escaping terminal control characters. A malicious package can therefore inject ANSI or OSC escape sequences into analyst terminals or CI logs.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"GuardDog is a CLI tool to identify malicious PyPI packages. From 2.6.0 to 2.9.0, GuardDog includes attacker-controlled filenames, file locations, messages, and code snippets in its default human-readable output without escaping terminal control characters. A malicious package can therefore inject ANSI or OSC escape sequences into analyst terminals or CI logs.","source":"cvelist"},{"lang":"en","text":"# Summary\nGuardDog includes attacker-controlled filenames, file locations, messages, and code snippets in its default human-readable output without escaping terminal control characters. A malicious package can therefore inject ANSI or OSC escape sequences into analyst terminals or CI logs.\n\n# Description\nThe finding formatter stores file paths and snippets from scanned content:\n\n```python\nlocation = file_path + \":\" + str(start_line)\nfinding = {\n    \"location\": location,\n    \"code\": code,\n    \"message\": result[\"extra\"][\"message\"],\n}\n```\n\nThe human-readable reporter later prints these values directly:\n\n```python\n\"  * \" + finding[\"message\"] + \" at \" + finding[\"location\"] + \"\\n    \" + _format_code_line_for_output(finding[\"code\"])\n```\n\nNo escaping is applied for control characters such as `\\x1b`. A malicious package can therefore ship a filename like:\n\n```text\nevil\\x1b[2J.py\n```\n\nor matched source lines containing terminal escapes, which survive into the final CLI output.\n\n# Reproduction summary\n1. Create a file whose name contains `\\x1b[2J`.\n2. Feed a semgrep-style result referencing that file into `Analyzer._format_semgrep_response()`.\n3. Render the result with `HumanReadableReporter.print_scan_results()`.\n4. The output string contains the raw escape bytes, which a terminal may interpret.\n\n# Key code paths\n- `guarddog/analyzer/analyzer.py:377-392`\n- `guarddog/reporters/human_readable.py:36-42`\n- `guarddog/reporters/human_readable.py:84-91`\n\n# Practical impact\nThis can be used to:\n- clear or rewrite analyst terminal output\n- inject misleading or spoofed log content in CI\n- emit clickable OSC 8 hyperlinks or title changes in compatible terminals\n\n# Prior public disclosure check\nAs of 2026-03-18, no matching public GitHub advisory, CVE, or public repo issue was found for this specific bug.\n\n# Suggested fix\nEscape or strip terminal control characters before rendering any attacker-controlled value in human-readable output. This should cover package names, file paths, messages, and code snippets.","format":"markdown","source":"ghsa"},{"lang":"es","text":"GuardDog es una herramienta de CLI para identificar paquetes de PyPI maliciosos. Desde 2.6.0 hasta 2.9.0, GuardDog incluye nombres de archivo, ubicaciones de archivo, mensajes y fragmentos de código controlados por el atacante en su salida predeterminada legible para humanos sin escapar los caracteres de control de terminal. Un paquete malicioso puede, por lo tanto, inyectar secuencias de escape ANSI u OSC en terminales de analistas o registros de CI.","source":"nvd"}],"published":"2026-05-11T14:43:43.000Z","modified":"2026-10-26T11:10:00.157Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":5,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":5,"rating":"MEDIUM"}],"cwes":["CWE-116"],"affected":[{"ranges":[{"version":">= 2.6.0, <= 2.9.0","status":"affected"}],"vendor":"DataDog","product":"guarddog","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.6.0","status":"affected","lastAffected":"2.9.0"}],"ecosystem":"PyPI","package":"guarddog","purl":"pkg:pypi/guarddog","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.6.0","status":"affected","lastAffected":"2.9.0"}],"ecosystem":"PyPI","package":"guarddog","purl":"pkg:pypi/guarddog","source":"pysec"}],"references":[{"url":"https://github.com/DataDog/guarddog/security/advisories/GHSA-m5p4-gvpx-4mvr","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44972","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/DataDog/guarddog","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/guarddog","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-m5p4-gvpx-4mvr","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-05-27T15:34:24.334Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-44972","url":"https://www.cve.org/CVERecord?id=CVE-2026-44972","licence":"CVE Terms of Use","modified":"2026-05-27T15:34:32.271Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m5p4-gvpx-4mvr","url":"https://github.com/advisories/GHSA-m5p4-gvpx-4mvr","licence":"CC-BY-4.0","modified":"2026-07-13T16:42:37.969Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-44972","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44972","licence":"Public domain","modified":"2026-10-26T11:10:00.157Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2506","url":"https://osv.dev/vulnerability/PYSEC-2026-2506","licence":"CC-BY-4.0","modified":"2026-07-13T16:31:56.153Z"}],"updatedAt":"2026-11-25T22:59:22.596Z","epss":{"score":0.00113,"percentile":0.01539,"date":"2026-12-02T12:00:21.000Z"}}