guarddog
Affected
- introduced
2.6.0, last affected2.9.0(ecosystem)
Fixed versions
None listed
Fix
No fixed version is listed.
Advisory
Also known as: CVE-2026-44972, GHSA-m5p4-gvpx-4mvr
GuardDog: Unsanitized human-readable scan output allows terminal escape injection from malicious package content
Summary
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.
Description
The finding formatter stores file paths and snippets from scanned content:
location = file_path + ":" + str(start_line)
finding = {
"location": location,
"code": code,
"message": result["extra"]["message"],
}
The human-readable reporter later prints these values directly:
" * " + finding["message"] + " at " + finding["location"] + "\n " + _format_code_line_for_output(finding["code"])
No escaping is applied for control characters such as \x1b. A malicious package can therefore ship a filename like:
evil\x1b[2J.py
or matched source lines containing terminal escapes, which survive into the final CLI output.
Reproduction summary
\x1b[2J.Analyzer._format_semgrep_response().HumanReadableReporter.print_scan_results().Key code paths
guarddog/analyzer/analyzer.py:377-392guarddog/reporters/human_readable.py:36-42guarddog/reporters/human_readable.py:84-91Practical impact
This can be used to:
Prior public disclosure check
As of 2026-03-18, no matching public GitHub advisory, CVE, or public repo issue was found for this specific bug.
Suggested fix
Escape 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.
Medium Basis: CVSS v3 score 5, vector CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
2.6.0, last affected 2.9.0 (ecosystem)None listed
No fixed version is listed.
Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: PyPA Advisory Database · CC BY 4.0