new file mode 100644
@@ -0,0 +1,55 @@
+From af73dab33be1161ed09aa20247e26d344a12f4d8 Mon Sep 17 00:00:00 2001
+From: Stefan Eissing <stefan@eissing.org>
+Date: Thu, 27 Aug 2026 09:47:53 +0200
+Subject: [PATCH] imap: APPEND CRLF fix
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Deny an APPEND operation with CRLF conversion requested as we are unable
+to predict the final upload size and APPEND requires us to announce it
+before starting the upload.
+
+The check for unknown sizes had already been there, but the crlf
+conversion that renders a known size unknown was not accounted for.
+
+Closes #22702
+
+CVE: CVE-2026-87864
+Upstream-Status: Backport [https://github.com/curl/curl/commit/3b547de301342b347fb3c6ea6ae7979070793a66]
+
+Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com>
+---
+ lib/imap.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/lib/imap.c b/lib/imap.c
+index 0e013e740a..6e4194b0cf 100644
+--- a/lib/imap.c
++++ b/lib/imap.c
+@@ -790,7 +790,6 @@ static CURLcode imap_perform_append(struct Curl_easy *data)
+ result = Curl_creader_set_mime(data, &data->set.mimepost);
+ if(result)
+ return result;
+- data->state.infilesize = Curl_creader_client_length(data);
+ }
+ else
+ #endif
+@@ -800,9 +799,15 @@ static CURLcode imap_perform_append(struct Curl_easy *data)
+ return result;
+ }
+
+- /* Check we know the size of the upload */
++ /* Check we know the size of the upload. This takes all readers
++ * into account. Especially crlf conversions which make the size
++ * unpredictable, e.g. -1. */
++ data->state.infilesize = Curl_creader_total_length(data);
+ if(data->state.infilesize < 0) {
+- failf(data, "Cannot APPEND with unknown input file size");
++ if(data->set.crlf)
++ failf(data, "Cannot APPEND with CRLF conversion making size unknown");
++ else
++ failf(data, "Cannot APPEND with unknown input file size");
+ return CURLE_UPLOAD_FAILED;
+ }
+
@@ -44,6 +44,7 @@ SRC_URI = "https://curl.se/download/${BP}.tar.xz \
file://CVE-2026-8286.patch \
file://CVE-2026-80230.patch \
file://CVE-2026-86409.patch \
+ file://CVE-2026-87864.patch \
"
SRC_URI:append:class-nativesdk = " \
This vulnerability, marked as High [1], was fixed upstream [2] since v8.22.0. Backport the fix to curl v8.7.1. [1] https://nvd.nist.gov/vuln/detail/cve-2026-87864 [2] https://curl.se/docs/CVE-2026-87864.html Signed-off-by: João Marcos Costa (Schneider Electric) <joaomarcos.costa@bootlin.com> --- .../curl/curl/CVE-2026-87864.patch | 55 +++++++++++++++++++ meta/recipes-support/curl/curl_8.7.1.bb | 1 + 2 files changed, 56 insertions(+) create mode 100644 meta/recipes-support/curl/curl/CVE-2026-87864.patch