CVE-2024-34062: Tqdm Tqdm CLI Arguments Injection Attack Vulnerability

LOW
Advisory Identifier: GHSA-g7vv-2v7x-gj9p
CVSS 3.9
CWE-74
Published
Advisory Summary

CVE-2024-34062 is a LOW (CVSS 3.9) tqdm cli arguments injection attack vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Tqdm libraries in the PyPI ecosystem. The issue involves tqdm cli arguments injection attack. Remediation is available by upgrading affected packages to version 4.66.3.

CVE-2024-34062 at a Glance

CVE Identifier CVE-2024-34062
GHSA Identifier GHSA-g7vv-2v7x-gj9p
Severity LOW
CVSS v3.1 Base Score 3.9
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Tqdm
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 3.9

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

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

How to Fix CVE-2024-34062

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

tqdm fixed: 4.66.3
pip install tqdm>=4.66.3
Verify Direct and Transitive Dependencies

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

pip show tqdm

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2024-34062, inspect your installed packages using pip:

pip show tqdm

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

Note: The pip show tqdm command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Tqdm, 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 Any optional non-boolean CLI arguments (e.g. `--delim`, `--buf-size`, `--manpath`) are passed through python's `eval`, allowing arbitrary code execution. Example: ```sh python -m tqdm --manpath="\" + str(exec(\"import os\nos.system('echo hi && killall python3')\")) + \"" ``` ### Patches https://github.com/tqdm/tqdm/commit/4e613f84ed2ae029559f539464df83fa91feb316 released in `tqdm>=4.66.3` ### Workarounds None ### References - https://github.com/tqdm/tqdm/releases/tag/v4.66.3

CVE-2024-34062 Affected Tqdm Versions

1 component(s)
Fixed Versions:
4.66.3
Product / Package Ecosystem Affected Versions Fixed Version
tqdm
PyPI
≥ 4.4.0
< 4.66.3
4.66.3

References

Frequently Asked Questions

What is CVE-2024-34062?
CVE-2024-34062 is a security vulnerability in Tqdm involving tqdm CLI arguments injection attack under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Tqdm versions are affected?
Affected versions include releases prior to 4.66.3 across affected packages: tqdm.
What version fixes CVE-2024-34062?
Upgrading to 4.66.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tqdm affected?
Yes, tqdm is affected in releases prior to 4.66.3. Upgrade your dependency to 4.66.3 or later.
What is the CVSS score of CVE-2024-34062?
CVE-2024-34062 has a CVSS v3.1 base score of 3.9 (LOW) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2024-34062?
CVE-2024-34062 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.).
How can I check PyPI dependencies for CVE-2024-34062?
Run the dependency tree command: 'pip show tqdm'. 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-g7vv-2v7x-gj9p",
  "modified" : "2024-06-10T18:30:57Z",
  "published" : "2024-05-03T19:33:28Z",
  "aliases" : [ "CVE-2024-34062" ],
  "summary" : "tqdm CLI arguments injection attack",
  "details" : "### Impact\nAny optional non-boolean CLI arguments (e.g. `--delim`, `--buf-size`, `--manpath`) are passed through python's `eval`, allowing arbitrary code execution. Example:\n\n```sh\npython -m tqdm --manpath=\"\\\" + str(exec(\\\"import os\\nos.system('echo hi && killall python3')\\\")) + \\\"\"\n```\n\n### Patches\nhttps://github.com/tqdm/tqdm/commit/4e613f84ed2ae029559f539464df83fa91feb316 released in `tqdm>=4.66.3`\n\n### Workarounds\nNone\n\n### References\n- https://github.com/tqdm/tqdm/releases/tag/v4.66.3",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tqdm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.4.0"
      }, {
        "fixed" : "4.66.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/tqdm/tqdm/security/advisories/GHSA-g7vv-2v7x-gj9p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-34062"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tqdm/tqdm/commit/4e613f84ed2ae029559f539464df83fa91feb316"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tqdm/tqdm"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PA3GIGHPWAHCTT4UF57LTPZGWHAX3GW6"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QRECVQCCESHBS3UJOWNXQUIX725TKNY6"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VA337CYUS4SLRFV2P6MX6MZ2LKFURKJC"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-03T19:33:28Z",
    "nvd_published_at" : "2024-05-03T10:15:08Z"
  }
}