Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
GHSA-m5p4-gvpx-4mvr
No affected components available
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
- Create a file whose name contains
\x1b[2J. - Feed a semgrep-style result referencing that file into
Analyzer._format_semgrep_response(). - Render the result with
HumanReadableReporter.print_scan_results(). - The output string contains the raw escape bytes, which a terminal may interpret.
Key code paths
guarddog/analyzer/analyzer.py:377-392guarddog/reporters/human_readable.py:36-42guarddog/reporters/human_readable.py:84-91
Practical impact
This can be used to:
- clear or rewrite analyst terminal output
- inject misleading or spoofed log content in CI
- emit clickable OSC 8 hyperlinks or title changes in compatible terminals
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.
The vulnerability requires local access to the device to be exploited. It is easy for an attacker to exploit this vulnerability. An attacker does not need any special privileges or access rights. The attacker needs the user to perform some action, like clicking a link. The vulnerability can affect other systems as well, not just the initial system. There is a low impact on the confidentiality of the information. There is a low impact on the integrity of the data.
Exploitation attempts have been detected. Elevated vigilance and prompt remediation are advised.
The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard