VAITP Dataset

← Back to the dataset

CVE-2022-27896

Log file vulnerability in Palantir Foundry Code-Workbooks 4.144 to 4.460.0 exposes tokens; fixed in 4.461.0

  • CVSS 7.5
  • CWE-532 Insertion of Sensitive Information into Log File
  • Information Leakage
  • Remote

Information Exposure Through Log Files vulnerability discovered in Foundry Code-Workbooks where the endpoint backing that console was generating service log records of any Python code being run. These service logs included the Foundry token that represents the Code-Workbooks Python console. Upgrade to Code-Workbooks version 4.461.0. This issue affects Palantir Foundry Code-Workbooks version 4.144 to version 4.460.0 and is resolved in 4.461.0.

CVSS base score
7.5
Published
2022-11-14
OWASP
A09 Security Logging and Monitoring Failures
Orthogonal defect classification
Function
Code defect classification
Extraneous Functionality
Category
Information Leakage
Subcategory
Information Disclosure
Accessibility scope
Remote
Impact
Information Disclosure
Affected component
Code-Workbooks
Fixed by upgrading
Yes

Solution

Upgrade to Code-Workbooks version 4.461.0.

Vulnerable code sample

import logging

# Configure logging that may expose sensitive information
logging.basicConfig(level=logging.DEBUG)

def execute_code(code, user_token):
    try:
        # Log the user token along with the executed code
        logging.debug("Executing code: %s with token: %s", code, user_token)
        exec(code)
    except Exception as e:
        logging.error("An error occurred while executing code: %s", e)

# Example usage
user_code = "print('Hello, World!')"
user_token = "sensitive_token_here"  # This will be logged
execute_code(user_code, user_token)

Patched code sample

import logging

# Configure logging to avoid sensitive information being logged
logging.basicConfig(level=logging.INFO)

def execute_code(code, user_token):
    # Avoid logging sensitive information such as the user token
    try:
        # Execute the user-provided code safely
        exec(code)
    except Exception as e:
        logging.error("An error occurred while executing code: %s", e)

# Example usage
user_code = "print('Hello, World!')"
user_token = "sensitive_token_here"  # This should not be logged
execute_code(user_code, user_token)

Cite this entry

@misc{vaitp:cve202227896,
  title        = {{Log file vulnerability in Palantir Foundry Code-Workbooks 4.144 to 4.460.0 exposes tokens; fixed in 4.461.0}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2022},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2022-27896},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2022-27896/}}
}

Download this entry as JSON Download the whole dataset

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 ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.