{"slug": "arize-phoenix-format-string-flaw-leaks-secrets-cve-2026-53998", "title": "Arize Phoenix Format-String Flaw Leaks Secrets (CVE-2026-53998)", "summary": "A format-string injection in Arize Phoenix's applyChatTemplate GraphQL query lets an attacker read os.environ, including PHOENIX_SECRET and stored AI credentials, in versions 13.0.0 through 15.6.x, according to a GitHub advisory rated CVSS v3.1 10.0 Critical and published on 2026-11-17. The flaw is fixed in arize-phoenix 15.7.0, released 2026-05-13, and no exploitation in the wild is known, with CISA ADP recording Exploitation: none and the CVE absent from KEV as of 2026-11-18. Users should upgrade to 15.7.0 or later and rotate PHOENIX_SECRET plus every credential stored in Phoenix, since the secret signs JWTs and derives the Fernet key encrypting stored credentials.", "body_md": "[Deep Dive](https://blog.ostorlab.co/category/deep-dive.html)\n\n# Arize Phoenix Format-String Flaw Leaks Secrets (CVE-2026-53998)\n\nA format-string flaw in Arize Phoenix 13.0.0 to 15.6.x exposes PHOENIX_SECRET and stored AI credentials; fixed in 15.7.0.\n\n## TL;DR\n\n- A format-string injection in Phoenix's `applyChatTemplate` GraphQL query lets an attacker read`os.environ` , including`PHOENIX_SECRET` . GitHub rated it CVSS v3.1 10.0 Critical and published a working payload on 2026-11-17.\n- Affects `arize-phoenix` 13.0.0 to 15.6.x. The fix is in 15.7.0, released on 2026-05-13.\n- No exploitation in the wild is known. CISA ADP records Exploitation: none, and the CVE is not in KEV as of 2026-11-18.\n- Upgrade to 15.7.0 or later, rotate `PHOENIX_SECRET` and every credential stored in Phoenix, and restrict network access to the API.\n\n## Am I affected?\n\nAll of these must hold:\n\n- `arize-phoenix` 13.0.0 or later, but earlier than 15.7.0, is running.\n- The GraphQL API is reachable by the attacker. On default installations, authentication is disabled.\n\nThe `F_STRING` format is selected inside the request payload itself; no server-side setting gates the flaw.\n\nThe CVE record was published on 2026-11-16 and the GitHub advisory on 2026-11-17. The fix commit is from 2026-05-13, so an installation that has been kept current since May is not exposed. The latest release on PyPI is 21.0.0.\n\nThe package had 135,422 downloads in the week to 2026-11-18 and 616,502 in the previous month, according to pypistats. The project has 12,341 GitHub stars. Those figures describe the project, not the number of exposed deployments.\n\nPhoenix ships as a Python package and as a container image, and both run the same GraphQL server. The version check covers either form. A managed deployment depends on the provider's patch schedule, so ask the provider which Phoenix version it runs and when it will carry 15.7.0.\n\n| Branch | Affected versions | Fixed version | \n|---|---|---|\n| 13.x to 15.6.x | 13.0.0 to 15.6.x | 15.7.0 | \n| 15.7.0 and later | None | Already fixed | \n\nCheck what is installed:\n\n```\n# The version in the current environment\npython -m pip show arize-phoenix\n\n# The version inside a running container\ndocker exec <container> python -m pip show arize-phoenix\n\n# A container image that has not been started\ndocker run --rm <image> python -m pip show arize-phoenix\n```\n\n## How do I fix it?\n\nUpgrade to 15.7.0 or later, then rotate the secrets that the old process could read. The fix is in the formatter, so a reverse proxy alone does not remove the flaw.\n\n1. Upgrade the package and restart the server:\n\n```\npython -m pip install --upgrade 'arize-phoenix>=15.7.0'\n```\n\n1. \nRebuild and recreate every container that runs Phoenix. Pulling a new image does not change a container that was created from the old one.\n2. \nRotate `PHOENIX_SECRET` . Phoenix uses it to sign JWTs and to derive the Fernet key that encrypts stored credentials. Changing it invalidates existing session tokens and makes credentials encrypted with the old key unreadable; plan to replace those stored credentials.\n3. \nRotate the LLM API keys, OAuth tokens, and database credentials that Phoenix stored or could read. Re-encrypt the stored credentials after the new secret is in place.\n4. \nIf you cannot upgrade yet, put the GraphQL API behind an authenticating proxy and remove network access from untrusted clients. That reduces exposure, but an authenticated user can still send the payload, so it is not a fix.\n5. \nIf a managed provider runs Phoenix for you, ask it to confirm the deployed version and the date it will reach 15.7.0. You cannot patch a hosted instance from your side, so the confirmation is the only control you have.\n\n## What is the root cause?\n\nThe f-string formatter passes an attacker-controlled template to Python's `str.format`, and the wrapper that was meant to block private attribute access does not run for dunder attributes. The traversal therefore reaches the namespace class's globals and reads `os.environ`.\n\nThe vulnerable method is `FStringTemplateFormatter._format` in `src/phoenix/utilities/template_formatters.py`:\n\n``` python\ndef _format(self, template: str, variable_names: Iterable[str], **variables: Any) -> str:\n    # Wrap dict and list variables to support attribute access (e.g., {user.name})\n    wrapped_variables = {key: _wrap_value(value) for key, value in variables.items()}\n    return template.format(**wrapped_variables)\n```\n\n`_wrap_value` turns a dictionary into `DotDict`, and `DotDict` extends `argparse.Namespace`. Its `__getattr__` blocks names that start with an underscore:\n\n``` php\ndef __getattr__(self, name: str) -> Any:\n    if name.startswith(\"_\"):\n        raise AttributeError(name)\n    raise AttributeError(f\"No attribute '{name}'\")\n```\n\nThat guard is ineffective for `__class__`. Python resolves `__class__` through normal attribute lookup on the object's type before it calls `__getattr__`, so the method never sees the name. From `__class__`, the template walks to `__bases__[0]`, which is `argparse.Namespace`, then to `Namespace.__init__.__globals__`. The `argparse` module imports `os` as `_os`, so `__globals__['_os'].environ` returns the process environment.\n\nThe `applyChatTemplate` resolver accepts a `PromptChatTemplateInput` and a `PromptTemplateOptions` value. The options choose the formatter and supply the variables. Nothing in the resolver restricts the template syntax or the attribute path.\n\nThe endpoint is not a debug-only surface. Phoenix uses the same formatter when a user previews a prompt in the UI or calls the API to render a prompt with variables. A deployment that lets users edit prompt templates therefore exposes the path to every user who can reach that feature, not only to an administrator.\n\n## How is it exploited?\n\nThe attacker sends one GraphQL request to the `applyChatTemplate` query with a template that walks from a supplied variable to the formatter's globals.\n\n1. The attacker reaches the GraphQL endpoint. On a default installation, no credentials are needed.\n2. The request supplies a template message whose text is `{u.__class__.__bases__[0].__init__.__globals__[_os].environ}` and a variable`u` with any dictionary value.\n3. The resolver selects `FStringTemplateFormatter` because the options set`format` to`F_STRING` .\n4. `_format` wraps`u` in`DotDict` and calls`template.format` . Python resolves the attribute chain and returns the environment as text in the response.\n5. The attacker reads `PHOENIX_SECRET` from that text, then forges an admin session token or derives the Fernet key that protects stored credentials.\n\nThe advisory publishes this payload:\n\n```\n{\n  \"query\": \"query($t: PromptChatTemplateInput!, $o: PromptTemplateOptions!) { applyChatTemplate(template: $t, templateOptions: $o) { messages { content { ... on TextContentPart { text { text } } } } } }\",\n  \"variables\": {\n    \"t\": { \"messages\": [{ \"role\": \"USER\", \"content\": [{ \"text\": { \"text\": \"{u.__class__.__bases__[0].__init__.__globals__[_os].environ}\" } }] }] },\n    \"o\": { \"format\": \"F_STRING\", \"variables\": { \"u\": { \"x\": 1 } } }\n  }\n}\n```\n\nThe response returns the environment as one text part. The attacker does not need to know the template syntax in advance: the advisory's payload is a normal GraphQL document, and the only unusual part is the attribute chain. A filter that blocks the exact strings `__class__` or `__globals__` would catch this payload, but a different traversal would evade a fixed string match.\n\n## How does the attack flow?\n\nOne unauthenticated GraphQL request walks from a template variable to the server's environment and returns the secret that protects every stored credential.\n\non the attacker template\"] C --> D[\"DotDict guard misses __class__\"] D --> E[\"Namespace globals expose _os.environ\"] E --> F[\"Response contains PHOENIX_SECRET\"] F --> G[\"Attacker forges admin JWT\n\nand decrypts stored credentials\"]\n\n## What can an attacker do?\n\nThe attacker can read the process environment and use the values in it to take over the Phoenix installation and the credentials it protects.\n\n- `PHOENIX_SECRET` lets the attacker sign a JWT for an administrator and derive the Fernet key used for stored credentials.\n- LLM API keys, OAuth tokens, and other provider credentials stored in Phoenix can be decrypted and used at the victim's expense.\n- Filesystem paths, loaded module names, and internal constants help the attacker plan a second step.\n\nThe advisory does not demonstrate code execution. The impact it documents is disclosure of the environment and the secrets in it, followed by token forgery and decryption with the leaked key.\n\n`PHOENIX_SECRET` is the master key for two operations. Phoenix signs session JWTs with it, so a leaked value lets the attacker mint a token for any user, including an administrator. Phoenix also derives the Fernet key that encrypts stored credentials from it, so the same value decrypts the LLM API keys and OAuth tokens in the database. Rotating one without the other leaves a window in which an old token or an old ciphertext still works.\n\nThe conditions are the same as in \"Am I affected?\": a vulnerable version, a reachable GraphQL API, and the `F_STRING` format. An installation with authentication enabled still exposes the data to any authenticated account, regardless of its privileges.\n\nReading the environment is the first step, not the end. The attacker still has to use the secret to sign a token or decrypt a stored value. Both operations are local to the attacker once the secret is known, and neither leaves a request in the Phoenix log.\n\n## Why does the fix work?\n\nThe fix replaces `str.format` with a `Formatter` subclass that rejects any attribute whose name starts with an underscore. That breaks the `__class__` step, so the template cannot reach `__globals__` or `os.environ`.\n\n``` python\n@@ -235,6 +235,39 @@ def _format(self, template: str, *args: Any, **variables: Any) -> str:\n         return template\n\n+_FIELD_NAME_PART_RE = re.compile(r\"\\.([^.\\[\\]]+)|\\[([^\\[\\]]+)\\]\")\n+\n+\n+class _SafeFieldFormatter(Formatter):\n+    \"\"\"\n+    A :class:`string.Formatter` that forbids access to \"private\" attributes.\n+\n+    Python's ``str.format`` resolves ``{x.attr}`` and ``{x[key]}`` expressions.\n+    Without restrictions, a malicious template can walk from a user-supplied\n+    value to ``__class__`` / ``__globals__`` / ``__builtins__`` and read process\n+    state (environment variables, secrets, etc.). This subclass blocks any\n+    attribute access whose name starts with an underscore, which is sufficient\n+    to break the traversal chain while preserving normal usage like\n+    ``{user.name}`` and ``{items[0].value}``.\n+    \"\"\"\n+\n+    def get_field(self, field_name: str, args: Any, kwargs: Any) -> Any:\n+        first = re.match(r\"^[^.\\[\\]]*\", field_name).group(0)  # type: ignore[union-attr]\n+        rest = field_name[len(first) :]\n+        key: Any = int(first) if first.isdigit() else first\n+        obj = self.get_value(key, args, kwargs)\n+        for attr, index in _FIELD_NAME_PART_RE.findall(rest):\n+            if attr:\n+                if attr.startswith(\"_\"):\n+                    raise TemplateFormatterError(\n+                        f\"Access to attribute '{attr}' is not permitted in templates\"\n+                    )\n+                obj = getattr(obj, attr)\n+            else:\n+                obj = obj[int(index) if index.lstrip(\"-\").isdigit() else index]\n+        return obj, first\n+\n+\n class FStringTemplateFormatter(TemplateFormatter):\n@@ -266,10 +299,14 @@ class FStringTemplateFormatter(TemplateFormatter):\n     def parse(self, template: str) -> set[str]:\n         return set(field_name for _, field_name, _, _ in Formatter().parse(template) if field_name)\n\n+    # Shared formatter that blocks traversal into \"private\"/dunder attributes,\n+    # preventing format-string injection (e.g. {x.__class__.__init__.__globals__}).\n+    _formatter = _SafeFieldFormatter()\n+\n     def _format(self, template: str, variable_names: Iterable[str], **variables: Any) -> str:\n         # Wrap dict and list variables to support attribute access (e.g., {user.name})\n         wrapped_variables = {key: _wrap_value(value) for key, value in variables.items()}\n-        return template.format(**wrapped_variables)\n+        return self._formatter.vformat(template, (), wrapped_variables)\n```\n\nThe change blocks the attribute-walk vector for both dot and bracket access. It does not add authentication to the resolver. The advisory recommended that as a separate mitigation, so a default installation still exposes the endpoint to anyone who can reach it. Network placement and authentication remain part of the exposure.\n\n## How do I check if I was compromised?\n\nThere are no published indicators of compromise. The request is a normal GraphQL POST, and a successful read returns the environment inside a normal response. A default access log records only the request line, so the POST body is the main trace when the proxy or a WAF keeps it.\n\n```\n# Access logs record only the request line by default; these greps match only\n# when the reverse proxy or a WAF logs the POST body (for example nginx $request_body).\ngrep -i \"applyChatTemplate\" /var/log/nginx/access.log /var/log/apache2/access.log 2>/dev/null\ngrep -i \"__class__\\|__globals__\\|__bases__\\|environ\" /var/log/nginx/access.log /var/log/apache2/access.log 2>/dev/null\n\n# Phoenix application logs, if request bodies are retained\ngrep -i \"applyChatTemplate\\|__class__\\|__globals__\\|__bases__\\|environ\" /var/log/phoenix/*.log 2>/dev/null\n```\n\nA hit on `applyChatTemplate` is a lead, not proof: the endpoint is also used by legitimate prompt tooling. A hit that also contains `__class__`, `__globals__`, or `environ` is much stronger. If you find one, rotate `PHOENIX_SECRET` and every stored provider credential, then review administrator sessions created after the request.\n\n## Timeline\n\n- 2026-02-13: `arize-phoenix` 13.0.0 is published with the vulnerable formatter.\n- 2026-05-13: commit `e7224a68` adds the safe formatter, and 15.7.0 is released.\n- 2026-11-16: the CVE record for CVE-2026-53998 is published.\n- 2026-11-17: the GitHub Advisory Database publishes GHSA-gfv3-m769-5xm3 with a working payload.\n- 2026-11-18: CISA ADP records Exploitation: none; the CVE is not in KEV.\n\n## FAQ\n\n### Can it be exploited without authentication?\n\nYes, on a default installation where authentication is disabled. If authentication is enabled, any account can send the request, regardless of its role.\n\n### Does it need user interaction?\n\nNo. The attacker sends one GraphQL request and reads the response. No victim has to open a link or approve anything.\n\n### Is there a public proof of concept?\n\nYes. The GitHub advisory includes a complete request payload that returns the environment. The advisory credits OmarXtream as the reporter.\n\n### Is 15.7.0 the only fixed release?\n\nNo. 15.7.0 is the first release with the safe formatter, and the latest release is 21.0.0. Any release from 15.7.0 onward carries the fix.\n\n### Does the fix add authentication?\n\nNo. The fix blocks the attribute traversal in the formatter. The resolver still has no authentication requirement, so a default installation remains reachable by anyone who can reach the API.\n\n### Was it exploited in the wild?\n\nNo exploitation is known. CISA ADP records Exploitation: none, and the CVE is not in KEV as of 2026-11-18.\n\n### Is the endpoint supposed to be public?\n\nOn a default installation, Phoenix disables authentication so that a local or trusted-network user can open the UI. That default is why the advisory calls the flaw unauthenticated. A production deployment that exposes the API beyond a trusted network should put authentication in front of it, even after the upgrade.\n\n### Does a managed Phoenix service use the same code?\n\nA managed service runs the same server code, but the provider controls the version and the network exposure. Ask the provider for the deployed version and the fix date. Your own package upgrade does not change a hosted instance.\n\n## Find exposed Phoenix APIs with Ostorlab\n\n[Ostorlab's Web Agentic Deep Scan](https://www.ostorlab.co/product/web_agentic_deep_scan) inventories and tests the web applications and APIs you expose. For a Phoenix deployment, it maps the reachable GraphQL surface and the authentication settings in front of it, so you can see which installations accept unauthenticated queries before you upgrade.\n\n## References\n\n- GitHub Advisory Database, GHSA-gfv3-m769-5xm3, \"Phoenix: Format String Injection in applyChatTemplate\": https://github.com/advisories/GHSA-gfv3-m769-5xm3 (checked November 18, 2026)\n- CVE record, CVE-2026-53998: https://www.cve.org/CVERecord?id=CVE-2026-53998 (checked November 18, 2026)\n- Arize Phoenix fix commit `e7224a68` , \"fix: prevent format-string injection in f-string template formatter\": https://github.com/Arize-ai/phoenix/commit/e7224a685589f2ffae1fefcc68ff210bd6ad28b8 (checked November 18, 2026)\n- Arize Phoenix release 15.7.0: https://github.com/Arize-ai/phoenix/releases/tag/arize-phoenix-v15.7.0 (checked November 18, 2026)\n- Arize Phoenix source at 15.6.0, `template_formatters.py` : https://github.com/Arize-ai/phoenix/blob/arize-phoenix-v15.6.0/src/phoenix/utilities/template_formatters.py (checked November 18, 2026)\n- Arize Phoenix source at 15.6.0, `queries.py` : https://github.com/Arize-ai/phoenix/blob/arize-phoenix-v15.6.0/src/phoenix/server/api/queries.py (checked November 18, 2026)\n- PyPI project page for `arize-phoenix` : https://pypi.org/project/arize-phoenix/ (checked November 18, 2026)\n- pypistats, `arize-phoenix` download statistics: https://pypistats.org/packages/arize-phoenix (checked November 18, 2026)\n- CISA Known Exploited Vulnerabilities catalog: https://www.cisa.gov/known-exploited-vulnerabilities-catalog (checked November 18, 2026)", "url": "https://wpnews.pro/news/arize-phoenix-format-string-flaw-leaks-secrets-cve-2026-53998", "canonical_source": "https://blog.ostorlab.co/arize-phoenix-format-string-secret-leak-cve-2026-53998.html", "published_at": "2026-11-18 12:05:00+00:00", "updated_at": "2026-11-18 16:43:26.976313+00:00", "lang": "en", "topics": ["ai-safety", "ai-tools", "mlops", "ai-agents"], "entities": ["Arize Phoenix", "arize-phoenix", "CISA", "GitHub", "PyPI", "PHOENIX_SECRET"], "also_reported_by": [], "takeaway": "The f-string formatter passed an attacker-controlled template to Python's str.format, and the wrapper meant to block private attribute access did not run for dunder attributes, so the traversal reached the namespace class's globals and read os.environ; upgrading to arize-phoenix 15.7.0 fixes the for", "recommendation": {"advice": "Upgrade arize-phoenix to 15.7.0 or later, then rotate PHOENIX_SECRET and every LLM API key, OAuth token and database credential Phoenix stored, since the old secret's Fernet key encrypted them.", "playbook": "agent-security", "playbook_url": "https://wpnews.pro/playbooks/agent-security"}, "alternates": {"html": "https://wpnews.pro/news/arize-phoenix-format-string-flaw-leaks-secrets-cve-2026-53998", "markdown": "https://wpnews.pro/news/arize-phoenix-format-string-flaw-leaks-secrets-cve-2026-53998.md", "text": "https://wpnews.pro/news/arize-phoenix-format-string-flaw-leaks-secrets-cve-2026-53998.txt", "jsonld": "https://wpnews.pro/news/arize-phoenix-format-string-flaw-leaks-secrets-cve-2026-53998.jsonld"}}