CVE-2026-21882 — Vulnerability in theshit — CVE Details
theshit's Improper Privilege Dropping Allows Local Privilege Escalation via Command Re-execution
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.20%). Schedule for your next planned update.
Does your project use an affected theshit version?
Paste your Cargo.lock to check it for CVE-2026-21882 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Impact
Vulnerability Type: Local Privilege Escalation (LPE) / Improper Privilege Management / Arbitrary Command Execution.
The application automatically re-executes the previously failed command but does not properly drop elevated privileges during this process.
When the tool is executed with sudo or otherwise runs with an effective UID of root, it records the last executed command and attempts to rerun it. However, the application fails to restore the original unprivileged user context before re-executing the command. As a result, the retried command is executed with root privileges, even if the original command was issued by an unprivileged user.
This allows a local attacker to intentionally trigger a failed command under elevated execution and gain arbitrary command execution as root via the retry mechanism.
Who is impacted:
Any system where this tool is executed with elevated privileges is affected. The risk is especially high in environments where the tool is permitted to run via sudo, including configurations with NOPASSWD, as an unprivileged user can escalate privileges to root without additional interaction.
Proof of Concept
To verify the vulnerability without a shell, attempt to create a file in a root-protected directory.
1. Verify the file does not exist
sudo ls /root/proof_of_lpe
# Output: No such file or directory
2. Run the vulnerable command
sudo bash -c "SH_PREV_CMD='touch /root/proof_of_lpe' target/release/theshit fix"
3. Check if the file was created by root
sudo ls -l /root/proof_of_lpe
Expected Result:
The command succeeds silently, and the file /root/proof_of_lpe is created, confirming arbitrary command execution with root privileges.
Patches
The issue has been fixed in version 0.1.2.
The patch ensures that privilege levels are correctly handled during command re-execution. Before retrying any previously executed command, the application now explicitly resets the effective UID and GID to the original invoking user.
Workarounds
If upgrading is not possible, users should avoid executing the application with sudo or as the root user.
As a temporary mitigation, administrators should restrict the use of the tool in privileged contexts and ensure it is not included in sudoers configurations, particularly with NOPASSWD. Running the tool strictly as an unprivileged user prevents exploitation of the retry mechanism.
References
- Commit fixing the issue
- CWE-269: Improper Privilege Management
- CWE-273: Improper Check for Dropped Privileges
- CWE-250: Execution with Unnecessary Privileges
Advisory Timeline
- First published March 2, 2026 (269 days ago).
- Last revised March 4, 2026 — 2 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
cargo update -p theshit --precise 0.2.0
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: crates.io (1).
| Package | Fixed In |
|---|---|
| theshit crates.io · Affected: All versions | 0.2.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-250
- CWE-269Improper Privilege ManagementMITRE
- CWE-273
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 8.4 score means for each attack dimension.
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
References
Frequently Asked Questions
- What is CVE-2026-21882?
- theshit's Improper Privilege Dropping Allows Local Privilege Escalation via Command Re-execution. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.4/10).
- How do I check if my project is affected by CVE-2026-21882?
- CVE-2026-21882 affects theshit. It has a 0.2% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-21882 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 5.7% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2025-69257HIGH
theshit vulnerable to unsafe loading of user-owned Python rules when running as root
- CVE-2026-83816HIGH
CodeWhale: exec_shell parallel-readonly classifier auto-approves fd/rg/git grep exec flags enabling silent RCE
- CVE-2026-83817HIGH
CodeWhale: Automation auto_approve defaults to true, bypassing the task-path hardening fix for silent recurring agent execution
- CVE-2025-69257HIGH
theshit vulnerable to unsafe loading of user-owned Python rules when running as root