CVE-2026-6019 PUBLISHED

BaseCookie.js_output() does not neutralize embedded characters

Assigner: PSF
Reserved: 09.04.2026 Published: 22.04.2026 Updated: 22.04.2026

http.cookies.Morsel.js_output() returns an inline <script> snippet and only escapes " for JavaScript string context. It does not neutralize the HTML parser-sensitive sequence </script> inside the generated script element. Mitigation base64-encodes the cookie value to disallow escaping using cookie value.

Metrics

CVSS Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
CVSS Score: 2.1

Product Status

Vendor Python Software Foundation
Product CPython
Versions Default: unaffected
  • affected from 0 to 3.15.0 (excl.)

Credits

  • oolongeya (https://github.com/komi22) reporter
  • Seth Larson (https://github.com/sethmlarson) coordinator

References

Problem Types

  • CWE-150 Improper neutralization of escape, meta, or control sequences CWE