CVE-2026-56813: Cookie attribute injection in Plug.Conn.Cookies.encode/2

Published Jul 10, 2026
·
Updated

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

1 affected component
hex/plug>=0.1.0<1.16.6, >=1.17.0<1.17.4, >=1.18.0<1.18.5, >=1.19.1<1.19.5, >=1.20.0<1.20.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade plug to a version that resolves this vulnerability.

    Fixed in 1.16.6
  2. Upgrade

    Upgrade plug to a version that resolves this vulnerability.

    Fixed in 1.17.4
  3. Upgrade

    Upgrade plug to a version that resolves this vulnerability.

    Fixed in 1.18.5
  4. Upgrade

    Upgrade plug to a version that resolves this vulnerability.

    Fixed in 1.19.5
  5. Upgrade

    Upgrade plug to a version that resolves this vulnerability.

    Fixed in 1.20.3

Event History

Jul 10, 2026
CVE Published
via MITRE·12:51 PM
Data Sourced
via MITRE·12:51 PM
DescriptionWeakness
Data Sourced
via NVD·01:16 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What is the severity of CVE-2026-56813?

CVE-2026-56813 has a low severity rating of 2.1.

2

What type of vulnerability is CVE-2026-56813?

CVE-2026-56813 is an Improper Neutralization of Parameter/Argument Delimiters vulnerability.

3

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.

4

In which software does CVE-2026-56813 occur?

CVE-2026-56813 occurs in the elixir-plug Plug software.

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203