chore(deps): update dependency phoenix_html to v4.4.0 [security] #640
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
high priority
invalid
L
low priority
M
medium priority
needs refinement
optional
question
S
security
technical improvement
UX Improvement
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
local-it/mitgliederverwaltung!640
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/hex-phoenix_html-vulnerability"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
4.3.0→4.4.0Phoenix.HTML vulnerable to attribute injection via unvalidated attribute names in attributes_escape/1
CVE-2026-117645 / EEF-CVE-2026-117645
More information
Details
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
Phoenix.HTML.attributes_escape/1.attributes_escape/1inlib/phoenix_html.exescapes attribute values but not attribute names.key_escape/1passes a binary key throughhtml_escape, which neutralizes quotes and angle brackets but not whitespace, so a key such asx onmouseoverends the attribute and starts a new one. An atom key is only dasherized, so any character passes, including quotes and>. Nesteddata,ariaandphxkeys 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 inPhoenix.HTML.Tag.This issue affects phoenix_html: from 1.0.0 before 3.3.5 and from 4.0.0 before 4.4.0.
Details
1. Attribute rendering.
Phoenix.HTML.attributes_escape/1walks the key-value pairs throughbuild_attrs/1andnested_attrs/3and emits each askey_escape(k)="attr_escape(v)". Values are escaped. Names are not checked against the HTML attribute-name grammar.2. Binary names.
key_escape/1sends a binary throughPhoenix.HTML.Engine.html_escape/1, which replaces&,<,>,"and'. Whitespace passes. HTML uses whitespace to separate attributes, so%{"x onmouseover" => "alert(1)"}rendersx onmouseover="alert(1)": a harmlessxattribute followed by an attacker-chosen event handler.3. Atom names.
key_escape/1converts an atom withAtom.to_string/1and replaces_with-. Nothing is escaped, so[{:"x\" onclick=\"alert(1)", "y"}]rendersx" onclick="alert(1)="y"andaria: [{:"x\"><script>", "y"}]rendersaria-x"><script>="y", which leaves the tag entirely. This path needs the application to create atoms from untrusted input, for exampleJason.decode!(body, keys: :atoms)orString.to_atom/1on a parameter.4. Reachability. HEEx compiles
<div {@​attrs}>to a call toPhoenix.HTML.attributes_escape/1throughPhoenix.LiveView.HTMLEngineandPhoenix.LiveView.TagEngine.tag/2andcontent_tag/3inPhoenix.HTML.Tag(phoenix_html 1.x to 3.x) and inPhoenixHTMLHelpers.Tag(4.x) render attributes the same way. Versions before 3.0.0 emitted the dasherized name without any escaping at all.Proof of concept
Mix.install([{:phoenix_html, "== 4.3.0"}]).Phoenix.HTML.attributes_escape(%{"x onmouseover" => "alert(1)"}) |> Phoenix.HTML.safe_to_string()returnsx onmouseover="alert(1)".Phoenix.HTML.attributes_escape([{:"x\" onclick=\"alert(1)", "y"}]) |> Phoenix.HTML.safe_to_string()returnsx" onclick="alert(1)="y".Phoenix.HTML.attributes_escape(aria: [{:"x\"><script>", "y"}]) |> Phoenix.HTML.safe_to_string()returnsaria-x"><script>="y".<div {@​attrs}>to deliver the injected attribute to a browser.Impact
An attacker who can influence the attribute names an application renders can add event-handler attributes or close the tag and run script in the browser of every user who views the page.
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 toattributes_escape/1or a HEEx{@​attrs}expression. Do not create atoms from request data.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
Release Notes
phoenixframework/phoenix_html (phoenix_html)
v4.4.0Compare Source
Security
Enhancements
Phoenix.HTML.json_escape/1to escape encoded JSON for safe insertion into an HTML script tagConfiguration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.
Pull request closed