CVE-2022-0338: Loguru Loguru Logs Sensitive Information Vulnerability

MODERATE
Advisory Identifier: GHSA-39ph-wr67-j4xq
CVSS 4.3
CWE-532 CWE-269
Published
Advisory Summary

CVE-2022-0338 is a MODERATE (CVSS 4.3) loguru logs sensitive information vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting Loguru libraries in the PyPI ecosystem. The issue involves loguru logs sensitive information. Remediation is available by upgrading affected packages to version 0.5.3.

CVE-2022-0338 at a Glance

CVE Identifier CVE-2022-0338
GHSA Identifier GHSA-39ph-wr67-j4xq
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-532: Insertion of Sensitive Information into Log File
Affected Product Loguru
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.3

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

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

How to Fix CVE-2022-0338

To remediate this vulnerability, upgrade all affected Loguru 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.5.3
pip install loguru>=0.5.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 loguru

How to Check if You Are Affected

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

pip show loguru

Analyze the terminal output to locate any version of Loguru in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.3), 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-532: Insertion of Sensitive Information into Log File, where the product writes sensitive information to a log file. In Loguru, 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

Insertion of Sensitive Information into Log File in Conda loguru prior to 0.5.3.

CVE-2022-0338 Affected Loguru Versions

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

References

Frequently Asked Questions

What is CVE-2022-0338?
CVE-2022-0338 is a security vulnerability in Loguru involving loguru logs sensitive information under CWE-532: Insertion of Sensitive Information into Log File.
Which Loguru versions are affected?
Affected versions include releases prior to 0.5.3 across affected packages: loguru.
What version fixes CVE-2022-0338?
Upgrading to 0.5.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is loguru affected?
Yes, loguru is affected in releases prior to 0.5.3. Upgrade your dependency to 0.5.3 or later.
What is the CVSS score of CVE-2022-0338?
CVE-2022-0338 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2022-0338?
CVE-2022-0338 is classified under CWE-532: Insertion of Sensitive Information into Log File (The product writes sensitive information to a log file.).
How can I check PyPI dependencies for CVE-2022-0338?
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-39ph-wr67-j4xq",
  "modified" : "2026-02-27T20:17:55Z",
  "published" : "2022-01-26T00:01:50Z",
  "aliases" : [ "CVE-2022-0338" ],
  "summary" : "loguru logs sensitive information",
  "details" : "Insertion of Sensitive Information into Log File in Conda loguru prior to 0.5.3.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "loguru"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-0338"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/delgan/loguru/commit/ea39375e62f9b8f18e2ca798a5c0fb8c972b7eaa"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Delgan/loguru"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/loguru/PYSEC-2022-14.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/359bea50-2bc6-426a-b2f9-175d401b1ed0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-269", "CWE-532" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-03T16:37:17Z",
    "nvd_published_at" : "2022-01-25T09:15:00Z"
  }
}