VAITP Dataset

← Back to the dataset

CVE-2024-1141

Access key is logged when DEBUG level is enabled in python-glance-store.

  • CVSS 5.5
  • CWE-779
  • Information Leakage
  • Remote

A vulnerability was found in python-glance-store. The issue occurs when the package logs the access_key for the glance-store when the DEBUG log level is enabled.

CVSS base score
5.5
Published
2024-02-01
OWASP
A03 Sensitive Data Exposure
Orthogonal defect classification
Checking
Code defect classification
Incorrect Check
Category
Information Leakage
Subcategory
Information Disclosure
Accessibility scope
Remote
Impact
Information Disclosure
Affected component
python-glanc
Fixed by upgrading
Yes

Solution

Upgrade to python-glance-store version 0.10.0 or later to mitigate the logging of access_key at DEBUG log level.

Vulnerable code sample

import logging

logging.basicConfig(level=logging.DEBUG)

def access_resource(access_key):
    """Vulnerable function that demonstrates the security issue."""
    logging.debug(f"Accessing resource with access key: {access_key}")
    return f"Resource accessed with key: {access_key}"

access_key = "my_secret_access_key"
access_resource(access_key)

Patched code sample

import logging

logging.basicConfig(level=logging.INFO)

def access_resource(access_key):
    """Secure function that fixes the vulnerability."""
    logging.info("Accessing resource with provided access key.")
    return f"Resource accessed with key: {access_key}"

access_key = "my_secret_access_key"
access_resource(access_key)

Payload

access_key = "my_secret_access_key"
logging.debug(f"Accessing resource with access key: {access_key}")

Cite this entry

@misc{vaitp:cve20241141,
  title        = {{Access key is logged when DEBUG level is enabled in python-glance-store.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2024},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2024-1141},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-1141/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::