CVE-2022-0329: Withdrawn Code Injection Vulnerability

LOW
Advisory Identifier: GHSA-cvp7-c586-cmf4
CWE-94
Published
Advisory Summary

CVE-2022-0329 is a LOW code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Withdrawn libraries in the PyPI ecosystem. The issue involves code injection in loguru. Remediation is available by upgrading affected packages to version 0.6.0.

CVE-2022-0329 at a Glance

CVE Identifier CVE-2022-0329
GHSA Identifier GHSA-cvp7-c586-cmf4
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Withdrawn
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2022-0329

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

loguru fixed: 0.6.0
pip install loguru>=0.6.0
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 loguru

How to Check if You Are Affected

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

pip show loguru

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Withdrawn, 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

# Withdrawn This advisory has been withdrawn after the maintainers of loguru noted this issue is not a security vulnerability and the CVE has been revoked. We have [stopped](https://github.com/Delgan/loguru/issues/563#issuecomment-1025223732) Dependabot alerts regarding this issue. ## Original Description In versions of loguru up to and including 0.5.3 a lack of sanitization on log serialization can lead to arbitrary code execution. The maintainer disputes the issue, but has altered behavior of the library in commit 4b0070a4f30cbf6d5e12e6274b242b62ea11c81b. See https://github.com/Delgan/loguru/issues/563 for further discussion of the issue. The function in question is intended for internal use only, but is not restricted. This has been patched in version 0.6.0.

CVE-2022-0329 Affected Withdrawn Versions

1 component(s)
Fixed Versions:
0.6.0
Product / Package Ecosystem Affected Versions Fixed Version
loguru
PyPI
< 0.6.0
0.6.0

References

Frequently Asked Questions

What is CVE-2022-0329?
CVE-2022-0329 is a security vulnerability in Withdrawn involving Code Injection in loguru under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Withdrawn versions are affected?
Affected versions include releases prior to 0.6.0 across affected packages: loguru.
What version fixes CVE-2022-0329?
Upgrading to 0.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is loguru affected?
Yes, loguru is affected in releases prior to 0.6.0. Upgrade your dependency to 0.6.0 or later.
What CWE is associated with CVE-2022-0329?
CVE-2022-0329 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check PyPI dependencies for CVE-2022-0329?
Run the dependency tree command: 'pip show loguru'. 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-cvp7-c586-cmf4",
  "modified" : "2022-02-01T15:17:33Z",
  "published" : "2022-01-28T22:01:45Z",
  "withdrawn" : "2022-02-01T15:17:33Z",
  "aliases" : [ "CVE-2022-0329" ],
  "summary" : "Withdrawn: Code Injection in loguru",
  "details" : "# Withdrawn\n\nThis advisory has been withdrawn after the maintainers of loguru noted this issue is not a security vulnerability and the CVE has been revoked. We have [stopped](https://github.com/Delgan/loguru/issues/563#issuecomment-1025223732) Dependabot alerts regarding this issue.\n\n## Original Description\n\nIn versions of loguru up to and including 0.5.3 a lack of sanitization on log serialization can lead to arbitrary code execution. The maintainer disputes the issue, but has altered behavior of the library in commit 4b0070a4f30cbf6d5e12e6274b242b62ea11c81b. See https://github.com/Delgan/loguru/issues/563 for further discussion of the issue. The function in question is intended for internal use only, but is not restricted. This has been patched in version 0.6.0.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "loguru"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.5.3"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-0329"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Delgan/loguru/issues/563"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/delgan/loguru/commit/4b0070a4f30cbf6d5e12e6274b242b62ea11c81b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/delgan/loguru"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/1-pypi-loguru"
  }, {
    "type" : "WEB",
    "url" : "https://tomforb.es/cve-2022-0329-and-the-problems-with-automated-vulnerability-management"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-25T23:33:20Z",
    "nvd_published_at" : "2022-01-21T11:15:00Z"
  }
}