---
id: CVE-2026-117645
title: >-
  Phoenix.HTML vulnerable to attribute injection via unvalidated attribute names
  in attributes_escape/1
summary: >-
  Improper Neutralization of Input During Web Page Generation ('Cross-site
  Scripting') vulnerability in phoenixframework phoenix_html allows an attacker
  who controls attribute names to inject attributes and script into rendered
  HTML via Ph…
severity: medium
cvss: 5.3
cvssVector: 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N'
cvssSource: cna
cwe:
  - CWE-79
vendor: phoenixframework
product: phoenix_html
affected:
  - phoenix_html >= 1.0.0 < 3.3.5
  - phoenix_html >= 4.0.0 < 4.4.0
  - >-
    phoenixframework/phoenix_html >= 6ad3a1d7960891a468d54636054a98e11dfb5111 <
    *
published: '2026-10-30'
updated: '2026-10-30'
sourceUpdated: '2026-10-30T20:25:06.758Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-117645'
references:
  - url: 'https://cna.erlef.org/cves/CVE-2026-117645.html'
    label: EEF CNA record for CVE-2026-117645
  - url: 'https://osv.dev/vulnerability/EEF-CVE-2026-117645'
    label: OSV record EEF-CVE-2026-117645
  - url: >-
      https://github.com/phoenixframework/phoenix_html/commit/6ad3a1d7960891a468d54636054a98e11dfb5111
    label: Introducing commit 6ad3a1d in phoenixframework/phoenix_html
  - url: >-
      https://github.com/phoenixframework/phoenix_html/commit/d9e4e6b2d9be49e25fb6d6b4fdbb2008174f01a6
    label: Fix commit d9e4e6b in phoenixframework/phoenix_html
  - url: >-
      https://github.com/phoenixframework/phoenix_html/commit/a47dc8944a773b7e9273d9691dc6744ec793f1de
    label: Fix commit a47dc89 in phoenixframework/phoenix_html
tags:
  - cve.org
epss: 0.00315
epssPercentile: 0.24544
ingestedAt: '2026-11-05T16:24:31.460Z'
---

## Overview

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in phoenixframework phoenix_html allows an attacker who controls attribute names to inject attributes and script into rendered HTML via Phoenix.HTML.attributes_escape/1.

attributes_escape/1 in lib/phoenix_html.ex escapes attribute values but not attribute names. key_escape/1 passes a binary key through html_escape, which neutralizes quotes and angle brackets but not whitespace, so a key such as x onmouseover ends the attribute and starts a new one. An atom key is only dasherized, so any character passes, including quotes and >. Nested data, aria and phx keys take the same paths. An application is affected when it builds attribute keys from untrusted input and renders them through HEEx <tag {@attrs}>, content_tag/3, or a direct call. Before 3.0.0 the same code lived in Phoenix.HTML.Tag.

This issue affects phoenix_html: from 1.0.0 before 3.3.5 and from 4.0.0 before 4.4.0.

## Affected

- `phoenix_html >= 1.0.0 < 3.3.5`
- `phoenix_html >= 4.0.0 < 4.4.0`
- `phoenixframework/phoenix_html >= 6ad3a1d7960891a468d54636054a98e11dfb5111 < *`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

### Workarounds

Do not derive attribute names from untrusted input. Where dynamic attribute keys are needed, check each key against an allow list, or against a pattern such as ^[a-zA-Z][a-zA-Z0-9:._-]*$, before passing the map to attributes_escape/1 or a HEEx {@attrs} expression. Do not create atoms from request data.
