CVE-2026-56813: Cookie attribute injection in Plug.Conn.Cookies.encode/2
Improper Neutralization of Parameter/Argument Delimiters vulnerability in elixir-plug plug allows an attacker to inject or override HTTP cookie attributes.
The Plug.Conn.Cookies.encode/2 function in lib/plug/conn/cookies.ex builds the Set-Cookie response header by interpolating the cookie value and its path, domain, samesite, and extra attributes directly into the header without neutralizing the ; delimiter that separates cookie attributes.
An application that places attacker-controlled data into a cookie value or attribute (for example via Plug.Conn.putrespcookie/4 when reflecting a username or preference) lets an attacker inject a ; to append or override cookie attributes (such as Domain and Path scope, or dropping the Secure and HttpOnly flags), enabling cookie tossing and session fixation. Carriage return, line feed, and null bytes are rejected by Plug.Conn header validation, so HTTP response splitting is not possible, but attribute injection through ; is not prevented.
This issue affects plug: from 0.1.0 before 1.16.6, from 1.17.0 before 1.17.4, from 1.18.0 before 1.18.5, from 1.19.1 before 1.19.5, and from 1.20.0 before 1.20.3.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
plugto a version that resolves this vulnerability.Fixed in 1.16.6 - Upgrade
Upgrade
plugto a version that resolves this vulnerability.Fixed in 1.17.4 - Upgrade
Upgrade
plugto a version that resolves this vulnerability.Fixed in 1.18.5 - Upgrade
Upgrade
plugto a version that resolves this vulnerability.Fixed in 1.19.5 - Upgrade
Upgrade
plugto a version that resolves this vulnerability.Fixed in 1.20.3
Event History
Frequently Asked Questions
What is the severity of CVE-2026-56813?
CVE-2026-56813 has a low severity rating of 2.1.
What type of vulnerability is CVE-2026-56813?
CVE-2026-56813 is an Improper Neutralization of Parameter/Argument Delimiters vulnerability.
How does CVE-2026-56813 impact HTTP cookie attributes?
CVE-2026-56813 allows an attacker to inject or override HTTP cookie attributes via the Plug.Conn.Cookies.encode/2 function.
In which software does CVE-2026-56813 occur?
CVE-2026-56813 occurs in the elixir-plug Plug software.
How can I mitigate the risk posed by CVE-2026-56813?
To mitigate CVE-2026-56813, you should update to a patched version of the elixir-plug Plug library.