CVE-2026-53998
Unauthenticated GraphQL F‑string injection allows env read and token forgery
- CVSS 10.0
- CWE-134
- Information Leakage
- Remote
Phoenix is an AI observability and evaluation platform. From 13.0.0 until 15.7.0, the applyChatTemplate GraphQL query passed attacker-controlled F-string templates to FStringTemplateFormatter._format, while DotDict.__getattr__ did not prevent traversal through Python private attributes. A crafted field could traverse object internals such as __class__, __init__, and __globals__ to read process environment variables and internal module state. The endpoint is unauthenticated on default installations, and any account can reach it when authentication is enabled. Exposure of PHOENIX_SECRET can allow administrative session-token forgery and decryption of credentials protected by keys derived from that secret. This issue is fixed in version 15.7.0.
- CWE
- CWE-134
- CVSS base score
- 10.0
- Published
- 2026-11-16
- OWASP
- A03 Injection
- Orthogonal defect classification
- Interface
- Code defect classification
- Incorrect Check
- Category
- Information Leakage
- Subcategory
- Information Disclosure
- Accessibility scope
- Remote
- Impact
- Information Disclosure
- Affected component
- Phoenix
Solution
Upgrade Phoenix to version 15.7.0 or later.
Vulnerable code sample
from typing import Any
class DotDict(dict):
"""Dictionary that allows attribute access, but does not restrict private attrs."""
def __getattr__(self, name: str) -> Any:
# VULNERABLE: allows traversal into private attributes like __class__
return getattr(self, name)
class FStringTemplateFormatter:
"""Formats an f-string template with a given context."""
def _format(self, template: str, context: dict) -> str:
# Execute the f-string in the provided context
return eval(f'f"""{template}"""', {}, context)
def apply_chat_template(user_template: str) -> str:
# Build context from request data (simulated)
ctx = DotDict({"message": "hello", "user": "alice"})
formatter = FStringTemplateFormatter()
# VULNERABLE: user-controlled template passed directly to f-string formatter
result = formatter._format(user_template, ctx)
return resultPatched code sample
from typing import Any
import ast
import _ast
class DotDict(dict):
"""Dictionary that allows attribute access, but restricts private attrs."""
def __getattr__(self, name: str) -> Any:
# FIX: block access to names starting with '__' to prevent traversal
if name.startswith("__"):
raise AttributeError(f"Access to private attribute '{name}' is forbidden")
return getattr(self, name)
class FStringTemplateFormatter:
"""Formats an f-string template with a given context, using safe AST parsing."""
def _format(self, template: str, context: dict) -> str:
# Parse the f-string as an AST and ensure only Name nodes are used
tree = ast.parse(f'f"""{template}"""', mode='eval')
for node in ast.walk(tree):
if isinstance(node, _ast.Attribute):
raise ValueError("Attribute access in templates is disallowed")
# Safe eval after validation
return eval(compile(tree, filename="<fstring>", mode='eval'), {}, context)
def apply_chat_template(user_template: str) -> str:
ctx = DotDict({"message": "hello", "user": "alice"})
formatter = FStringTemplateFormatter()
# FIX: user template is validated before formatting, preventing unsafe traversal
result = formatter._format(user_template, ctx)
return resultPublished fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- fix: prevent format-string injection in f-string template formatter (#13197) (Arize-ai/phoenix)
src/phoenix/utilities/template_formatters.py,src/phoenix/utilities/template_formatters.py · FStringTemplateFormatter._format
Cite this entry
@misc{vaitp:cve202653998,
title = {{Unauthenticated GraphQL F‑string injection allows env read and token forgery}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-53998},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-53998/}}
}
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 ::
