VAITP Dataset

← Back to the dataset

CVE-2026-84691

Admin‑controlled Python format string leaks Django secret key and DB password via log forwarding.

  • CVSS 8.7
  • CWE-134
  • Information Leakage
  • Remote

A flaw was found in Red Hat Ansible Automation Platform's automation- controller. The setting that formats the log message emitted for API 4XX errors is an administrator-controlled Python format-string template that is rendered with a live user object as an argument. Because Python string formatting permits attribute and item traversal on its arguments, an administrator can craft a template that walks from the user object into the application settings and reads the Django secret key and the database password. The formatted message is written to a logger that can be forwarded to an external log aggregator, whose destination is also administrator-controlled, allowing the secrets to be sent off the host. An authenticated administrator can thereby obtain the master encryption key used to protect all stored credentials and the database service password, enabling offline decryption of every stored credential, forgery of user sessions, and direct access to the controller database.

CVSS base score
8.7
Published
2026-09-23
OWASP
A09 Security Logging and Monitoring Failures
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Information Leakage
Subcategory
Information Disclosure
Accessibility scope
Remote
Impact
Data Theft
Affected component
Python

Solution

Upgrade Red Hat Ansible Automation Platform’s automation‑controller to version 2.4.2 (or later) where the vulnerable log‑message format‑string is fixed.

Vulnerable code sample

import logging
from django.conf import settings
from django.contrib.auth.models import User

logger = logging.getLogger("ansible_controller")

def log_api_error(request, user: User, status_code: int):
    """
    Logs an API error. For 4XX responses a custom format string
    (admin‑controlled) is used to build the log message.
    """
    # Admin can set this via a DB field; here we simulate it.
    log_template = settings.API_ERROR_LOG_TEMPLATE  # e.g. "{user.__class__.__module__}.{user.__dict__[\"password\"]}"
    if 400 <= status_code < 500:
        # VULNERABLE: unsafe format string with user object
        message = log_template.format(user=user)
        logger.error(message)
    else:
        logger.error("API error %s for user %s", status_code, user.username)

Patched code sample

import logging
from django.conf import settings
from django.contrib.auth.models import User

logger = logging.getLogger("ansible_controller")

def log_api_error(request, user: User, status_code: int):
    """
    Logs an API error. For 4XX responses a custom format string
    (admin‑controlled) is used to build the log message.
    """
    # Admin can set this via a DB field; here we simulate it.
    log_template = settings.API_ERROR_LOG_TEMPLATE
    if 400 <= status_code < 500:
        # FIX: use safe substitution, no format string evaluation
        safe_template = "API 4XX error for user {username}"
        message = safe_template.format(username=user.username)
        logger.error(message)
    else:
        logger.error("API error %s for user %s", status_code, user.username)

Cite this entry

@misc{vaitp:cve202684691,
  title        = {{Admin‑controlled Python format string leaks Django secret key and DB password via log forwarding.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-84691},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-84691/}}
}

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.