VAITP Dataset

← Back to the dataset

CVE-2024-49750

Snowflake Connector for Python exposed sensitive data in DEBUG logs.

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

The Snowflake Connector for Python provides an interface for developing Python applications that can connect to Snowflake and perform all standard operations. Prior to version 3.12.3, when the logging level was set by the user to DEBUG, the Connector could have logged Duo passcodes (when specified via the `passcode` parameter) and Azure SAS tokens. Additionally, the SecretDetector logging formatter, if enabled, contained bugs which caused it to not fully redact JWT tokens and certain private key formats. Snowflake released version 3.12.3 of the Snowflake Connector for Python, which fixes the issue. In addition to upgrading, users should review their logs for any potentially sensitive information that may have been captured.

CVSS base score
5.5
Published
2024-10-24
OWASP
A03 Sensitive Data Exposure
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Information Leakage
Subcategory
Insecure Handling of Sensitive Data
Accessibility scope
Remote
Impact
Information Disclosure
Affected component
Snowflake Co
Fixed by upgrading
Yes

Solution

Upgrade to version 3.12.3 of the Snowflake Connector for Python and review logs for sensitive information.

Vulnerable code sample

import logging
from snowflake.connector import connect

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('snowflake.connector')

user = 'your_username'
password = 'your_password'
account = 'your_account'
passcode = 'your_duo_passcode'

conn = connect(
    user=user,
    password=password,
    account=account,
    passcode=passcode
)

cursor = conn.cursor()
try:
    cursor.execute("SELECT CURRENT_VERSION()")
    print(cursor.fetchone())
finally:
    cursor.close()
    conn.close()

Patched code sample

import logging
from snowflake.connector import connect
import os

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('snowflake.connector')

user = os.getenv('SNOWFLAKE_USER')
password = os.getenv('SNOWFLAKE_PASSWORD')
account = os.getenv('SNOWFLAKE_ACCOUNT')
passcode = os.getenv('SNOWFLAKE_PASSCODE')

if not all([user, password, account, passcode]):
    logger.error("Missing environment variables for Snowflake credentials.")
    exit(1)

conn = connect(
    user=user,
    password=password,
    account=account,
    passcode=passcode
)

cursor = conn.cursor()
try:
    cursor.execute("SELECT CURRENT_VERSION()")
    print(cursor.fetchone())
finally:
    cursor.close()
    conn.close()

Payload

passcode = 'DuoPasscode123'  # Example of a Duo passcode that could be logged

Cite this entry

@misc{vaitp:cve202449750,
  title        = {{Snowflake Connector for Python exposed sensitive data in DEBUG logs.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2024},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2024-49750},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-49750/}}
}
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 ::