CVE-2026-22871 in guarddoginfo

Summary

by MITRE • 01/13/2026

GuardDog is a CLI tool to identify malicious PyPI packages. Prior to 2.7.1, there is a path traversal vulnerability exists in GuardDog's safe_extract() function that allows malicious PyPI packages to write arbitrary files outside the intended extraction directory, leading to Arbitrary File Overwrite and Remote Code Execution on systems running GuardDog. This vulnerability is fixed in 2.7.1.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 01/22/2026

The vulnerability identified as CVE-2026-22871 affects GuardDog, a command-line interface tool designed to detect malicious Python Package Index packages. This tool serves as a security mechanism for developers and organizations to identify potentially harmful packages before installation. The flaw exists in the safe_extract() function implementation within GuardDog versions prior to 2.7.1, creating a critical security gap that can be exploited by attackers. The vulnerability stems from inadequate input validation and path handling during the extraction process of package contents, specifically when processing archive files from the Python Package Index.

The technical implementation of this path traversal vulnerability occurs within the safe_extract() function where the tool fails to properly sanitize file paths contained within package archives. When GuardDog processes a malicious PyPI package, it attempts to extract files from the archive without sufficient validation of the target file paths. This allows attackers to craft package contents that contain file paths with directory traversal sequences such as ../ or ..\ that would cause the extraction process to write files outside the intended target directory. The vulnerability is classified as CWE-22 Path Traversal and aligns with ATT&CK technique T1059.001 Command and Scripting Interpreter, specifically targeting the execution of arbitrary code through file system manipulation.

The operational impact of this vulnerability is severe and multifaceted, potentially leading to both arbitrary file overwrite and remote code execution on systems where GuardDog is installed. An attacker who successfully exploits this vulnerability can write malicious files to critical system locations such as system directories, configuration files, or even overwrite executable binaries. This capability enables attackers to achieve persistent access, escalate privileges, or deploy additional malicious payloads. The vulnerability affects any system running GuardDog version 2.7.0 or earlier, making it particularly concerning for development environments, continuous integration pipelines, and security tooling that relies on GuardDog for package validation. The remote code execution potential arises from the ability to overwrite system binaries or configuration files that are subsequently executed by the operating system or other security tools.

The mitigation for this vulnerability requires immediate upgrading to GuardDog version 2.7.1 or later, which includes proper path sanitization and validation within the safe_extract() function. Organizations should conduct thorough vulnerability assessments to identify systems running vulnerable versions of GuardDog and ensure all instances are updated. Security teams should also implement monitoring for suspicious file creation patterns in directories where GuardDog operates, as these could indicate exploitation attempts. Additionally, organizations should consider implementing network segmentation and access controls to limit the potential impact of successful exploitation. The fix implemented in version 2.7.1 addresses the root cause by properly validating and sanitizing file paths during extraction, preventing directory traversal sequences from being processed and ensuring all extracted files remain within the intended directory boundaries. This vulnerability highlights the critical importance of proper input validation in security tools, as tools designed to protect against malicious packages can themselves become attack vectors when not properly secured against path traversal attacks.

Responsible

GitHub M

Reservation

01/12/2026

Disclosure

01/13/2026

Moderation

accepted

CPE

ready

EPSS

0.00236

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!