Skip to content

Unsafe loading of user-owned Python rules when running as root.

High
AsfhtgkDavid published GHSA-95qg-89c2-w5hj Dec 30, 2025

Package

cargo theshit (Rust)

Affected versions

< 0.1.1

Patched versions

0.1.1

Description

Impact

Vulnerability Type: Local Privilege Escalation (LPE) / Arbitrary Code Execution.

The application loads custom Python rules and configuration files from user-writable locations (e.g., ~/.config/theshit/) without validating ownership or permissions when executed with elevated privileges.

If the tool is invoked with sudo or otherwise runs with an effective UID of root, it continues to trust configuration files originating from the unprivileged user's environment. This allows a local attacker to inject arbitrary Python code via a malicious rule or configuration file, which is then executed with root privileges.

Who is impacted:
Any system where this tool is executed with elevated privileges is affected. In environments where the tool is permitted to run via sudo without a password (NOPASSWD), a local unprivileged user can escalate privileges to root without additional interaction.

Patches

The issue has been fixed in version 0.1.1.

The patch introduces strict ownership and permission checks for all configuration files and custom rules. The application now enforces that rules are only loaded if they are owned by the effective user executing the tool.

When executed with elevated privileges (EUID=0), the application refuses to load any files that are not owned by root or that are writable by non-root users. When executed as a non-root user, it similarly refuses to load rules owned by other users. This prevents both vertical and horizontal privilege escalation via execution of untrusted code.

Workarounds

If upgrading is not possible, users should avoid executing the pplication with sudo or as the root user.

As a temporary mitigation, ensure that directories containing custom rules and configuration files are owned by root and are not writable by non-root users. Administrators may also audit existing custom rules before running the tool with elevated privileges.

References

  • Commit fixing the issue
  • CWE-269: Improper Privilege Management
  • CWE-284: Improper Access Control
  • CWE-829: Inclusion of Functionality from Untrusted Control Sphere

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

CVE ID

CVE-2025-69257

Weaknesses

Improper Privilege Management

The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. Learn more on MITRE.

Improper Access Control

The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. Learn more on MITRE.

Inclusion of Functionality from Untrusted Control Sphere

The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. Learn more on MITRE.

Credits