CVE-2025-69257
JSON

6.7medium

theshit vulnerable to unsafe loading of user-owned Python rules when running as root.

Severity
6.7medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.14% (higher than 3% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-95qg-89c2-w5hjRUSTSEC-2025-0139

Description

theshit is a command-line utility that automatically detects and fixes common mistakes in shell commands. Prior to version 0.1.1, 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. 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. 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. If upgrading is not possible, users should avoid executing the application 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.

Affected

Product or packageVersionsReported by
AsfhtgkDavid theshit< 0.1.1CVE List
theshit (crates.io)before 0.1.1, from 0.0.0-0 before 0.1.1GitHub Advisory Database, RustSec Advisory Database

All scores

GitHub_M6.7medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H
GitHub7.3high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
RustSec Advisory Database7.3high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

Classification

CWE-269CWE-284CWE-829

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

theshit is a command-line utility that automatically detects and fixes common mistakes in shell commands. Prior to version 0.1.1, 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. 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. 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. If upgrading is not possible, users should avoid executing the application 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.

GitHub Advisory Database
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
RustSec Advisory Database

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.

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.

NVD (es)

theshit es una utilidad de línea de comandos que detecta y corrige automáticamente errores comunes en los comandos de shell. Antes de la versión 0.1.1, la aplicación carga reglas Python personalizadas y archivos de configuración desde ubicaciones escribibles por el usuario (por ejemplo, '~/.config/theshit/') sin validar la propiedad o los permisos cuando se ejecuta con privilegios elevados. Si la herramienta se invoca con 'sudo' o se ejecuta de otra manera con un UID efectivo de root, continúa confiando en los archivos de configuración originados en el entorno del usuario sin privilegios. Esto permite a un atacante local inyectar código Python arbitrario a través de una regla o archivo de configuración malicioso, que luego se ejecuta con privilegios de root. Cualquier sistema donde esta herramienta se ejecute con privilegios elevados se ve afectado. En entornos donde se permite que la herramienta se ejecute a través de 'sudo' sin contraseña ('NOPASSWD'), un usuario local sin privilegios puede escalar privilegios a root sin interacción adicional. El problema ha sido solucionado en la versión 0.1.1. El parche introduce estrictas comprobaciones de propiedad y permisos para todos los archivos de configuración y reglas personalizadas. La aplicación ahora exige que las reglas solo se carguen si son propiedad del usuario efectivo que ejecuta la herramienta. Cuando se ejecuta con privilegios elevados ('EUID=0'), la aplicación se niega a cargar cualquier archivo que no sea propiedad de root o que sea escribible por usuarios que no sean root. Cuando se ejecuta como un usuario que no es root, de manera similar se niega a cargar reglas propiedad de otros usuarios. Esto previene la escalada de privilegios tanto vertical como horizontal mediante la ejecución de código no confiable. Si la actualización no es posible, los usuarios deben evitar ejecutar la aplicación con 'sudo' o como usuario root. Como mitigación temporal, asegúrese de que los directorios que contienen reglas personalizadas y archivos de configuración sean propiedad de root y no sean escribibles por usuarios que no sean root. Los administradores también pueden auditar las reglas personalizadas existentes antes de ejecutar la herramienta con privilegios elevados.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-69257 changed 2025-12-30CVE Terms of Use
GitHub Advisory DatabaseGHSA-95qg-89c2-w5hj changed 2026-02-03CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2025-0139 changed 2026-10-12CC0-1.0
NVDCVE-2025-69257 changed 2026-06-17Public domain