CVE-2026-21882

CVE-2026-21882 is a high-severity improper privilege management vulnerability in theshit (rust), affecting versions < 0.2.0. It is fixed in 0.2.0.

Summary

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.

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

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.

The application assigns, modifies, tracks, or checks privileges incorrectly, allowing a user to gain elevated access. Typical impact: privilege escalation beyond the intended level.

CVE-2026-21882 has a CVSS score of 8.4 (High). The vector is requires local access, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.2.0); upgrading removes the vulnerable code path.

Affected versions

theshit (< 0.2.0)

Security releases

theshit → 0.2.0 (rust)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

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.

Frequently Asked Questions

  1. What is CVE-2026-21882? CVE-2026-21882 is a high-severity improper privilege management vulnerability in theshit (rust), affecting versions < 0.2.0. It is fixed in 0.2.0. The application assigns, modifies, tracks, or checks privileges incorrectly, allowing a user to gain elevated access.
  2. How severe is CVE-2026-21882? CVE-2026-21882 has a CVSS score of 8.4 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of theshit are affected by CVE-2026-21882? theshit (rust) versions < 0.2.0 is affected.
  4. Is there a fix for CVE-2026-21882? Yes. CVE-2026-21882 is fixed in 0.2.0. Upgrade to this version or later.
  5. Is CVE-2026-21882 exploitable, and should I be worried? Whether CVE-2026-21882 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-21882 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-21882? Upgrade theshit to 0.2.0 or later.

Other vulnerabilities in theshit

CVE-2025-69257

Stop the waste.
Protect your environment with Kodem.