CVE-2026-87864: curl IMAP APPEND plus CRLF conversion command injection

CVE-2026-87864 · Severity: info · Published 2026-10-20

curl is a widely-used data transfer library and command-line tool that supports many protocols including IMAP email access. When CRLF line-ending conversion is enabled for IMAP, curl miscounts the payload size, causing the mail server to misinterpret extra bytes as authenticated IMAP commands, potentially allowing an attacker to execute arbitrary IMAP operations within an authenticated session.

Technologies: Curl. Vendors: Curl.

Quick answers

Is CVE-2026-87864 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-87864 being exploited in the wild.
How severe is CVE-2026-87864?
Informational severity, published 20 October 2026.
Which products and versions are affected?
Curl 7.30.0 to 8.21.0, including 7.30.0-7.88.1 and 8.0.0-8.21.0.
Is there a fix for CVE-2026-87864?
Yes: fixed in curl 8.22.0, 8.20.2, 8.16.2, 8.14.3. Until then: Avoid using CURLOPT_CRLF with IMAP operations, or upgrade to a patched version. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-87864 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-87864?
Check whether you run Curl at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • Fixed in: curl 8.22.0, 8.20.2, 8.16.2, 8.14.3

Avoid using CURLOPT_CRLF with IMAP operations, or upgrade to a patched version.

Technical details

When CURLOPT_CRLF is enabled for IMAP APPEND operations, curl advertises the raw input byte count in the IMAP APPEND {N} literal but transmits line-ending expanded data, causing a length mismatch. The server reads only N bytes, leaving overflow bytes that are interpreted as pipelined IMAP commands in the authenticated session. This is a length parameter inconsistency vulnerability (CWE-130) requiring prior IMAP authentication.

Affected products

  • curl curl 7.30.0 to 8.21.0, including 7.30.0-7.88.1 and 8.0.0-8.21.0

Timeline

  • 2026-08-26: disclosed: Issue reported to curl project
  • 2026-09-02: patched: curl 8.22.0 released
  • 2026-10-14: advisory: Security advisory published

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.