CVE-2026-21882: Theshit Theshit's Improper Privilege Dropping Allows Vulnerability

HIGH
Advisory Identifier: GHSA-2j3p-gqw5-g59j
CVSS 8.4
CWE-269 CWE-273 CWE-250
Published
Advisory Summary

CVE-2026-21882 is a HIGH (CVSS 8.4) theshit's improper privilege dropping allows vulnerability (CWE-269: Improper Privilege Management) affecting Theshit libraries in the crates.io ecosystem. The issue involves theshit's improper privilege dropping allows local privilege escalation via command re-execution. Remediation is available by upgrading affected packages to version 0.2.0.

CVE-2026-21882 at a Glance

CVE Identifier CVE-2026-21882
GHSA Identifier GHSA-2j3p-gqw5-g59j
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-269: Improper Privilege Management
Affected Product Theshit
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 8.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-21882

To remediate this vulnerability, upgrade all affected Theshit dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

theshit fixed: 0.2.0
Upgrade theshit to 0.2.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for theshit

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-21882, inspect your project dependencies for Theshit:

inspect dependencies for theshit

Analyze the terminal output to locate any version of Theshit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-269: Improper Privilege Management, where the product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. In Theshit, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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** ```bash sudo ls /root/proof_of_lpe # Output: No such file or directory ``` **2. Run the vulnerable command** ```bash sudo bash -c "SH_PREV_CMD='touch /root/proof_of_lpe' target/release/theshit fix" ``` **3. Check if the file was created by root** ```bash 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](https://github.com/AsfhtgkDavid/theshit/commit/5293957b119e55212dce2c6dcbaf1d7eb794602a) * CWE-269: Improper Privilege Management * CWE-273: Improper Check for Dropped Privileges * CWE-250: Execution with Unnecessary Privileges

CVE-2026-21882 Affected Theshit Versions

1 component(s)
Fixed Versions:
0.2.0
Product / Package Ecosystem Affected Versions Fixed Version
theshit
crates.io
< 0.2.0
0.2.0

References

Frequently Asked Questions

What is CVE-2026-21882?
CVE-2026-21882 is a security vulnerability in Theshit involving theshit's Improper Privilege Dropping Allows Local Privilege Escalation via Command Re-execution under CWE-269: Improper Privilege Management.
Which Theshit versions are affected?
Affected versions include releases prior to 0.2.0 across affected packages: theshit.
What version fixes CVE-2026-21882?
Upgrading to 0.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is theshit affected?
Yes, theshit is affected in releases prior to 0.2.0. Upgrade your dependency to 0.2.0 or later.
What is the CVSS score of CVE-2026-21882?
CVE-2026-21882 has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-21882?
CVE-2026-21882 is classified under CWE-269: 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.).
How can I check crates.io dependencies for CVE-2026-21882?
Run the dependency tree command: 'inspect dependencies for theshit'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2j3p-gqw5-g59j",
  "modified" : "2026-03-02T21:59:23Z",
  "published" : "2026-03-02T17:44:53Z",
  "aliases" : [ "CVE-2026-21882" ],
  "summary" : "theshit's Improper Privilege Dropping Allows Local Privilege Escalation via Command Re-execution",
  "details" : "### Impact\n\n**Vulnerability Type:** Local Privilege Escalation (LPE) / Improper Privilege Management / Arbitrary Command Execution.\n\nThe application automatically re-executes the previously failed command but does not properly drop elevated privileges during this process.\n\nWhen 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.\n\nThis allows a local attacker to intentionally trigger a failed command under elevated execution and gain arbitrary command execution as root via the retry mechanism.\n\n**Who is impacted:**\nAny 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.\n\n### Proof of Concept\n\nTo verify the vulnerability without a shell, attempt to create a file in a root-protected directory.\n\n**1. Verify the file does not exist**\n```bash\nsudo ls /root/proof_of_lpe\n# Output: No such file or directory\n```\n\n**2. Run the vulnerable command**\n```bash\nsudo bash -c \"SH_PREV_CMD='touch /root/proof_of_lpe' target/release/theshit fix\"\n```\n\n**3. Check if the file was created by root**\n```bash\nsudo ls -l /root/proof_of_lpe\n```\n\n**Expected Result:**\nThe command succeeds silently, and the file `/root/proof_of_lpe` is created, confirming arbitrary command execution with root privileges.\n\n### Patches\n\nThe issue has been fixed in version **0.1.2**.\n\nThe 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.\n\n### Workarounds\n\nIf upgrading is not possible, users should avoid executing the application with `sudo` or as the root user.\n\nAs 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.\n\n### References\n\n* [Commit fixing the issue](https://github.com/AsfhtgkDavid/theshit/commit/5293957b119e55212dce2c6dcbaf1d7eb794602a)\n* CWE-269: Improper Privilege Management\n* CWE-273: Improper Check for Dropped Privileges\n* CWE-250: Execution with Unnecessary Privileges",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "theshit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/AsfhtgkDavid/theshit/security/advisories/GHSA-2j3p-gqw5-g59j"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-21882"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/AsfhtgkDavid/theshit/commit/5293957b119e55212dce2c6dcbaf1d7eb794602a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/AsfhtgkDavid/theshit"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-250", "CWE-269", "CWE-273" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-02T17:44:53Z",
    "nvd_published_at" : "2026-03-02T20:16:26Z"
  }
}