new file mode 100644
@@ -0,0 +1,220 @@
+From 835f55d8f87da137c262af5d16ba209bcd4398de Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Mon, 21 Sep 2026 11:13:13 +0200
+Subject: [PATCH] getinfo: make sure CURLINFO_EFFECTIVE_URL does not contain
+ creds
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Reported-by: Joshua Rogers
+
+Verified in test 1876
+
+Closes #23016
+
+CVE: CVE-2026-94266
+Upstream-Status: Backport [https://github.com/curl/curl/commit/7a6bd027d0de2b6857472d35da090ef60cc29f19]
+
+Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com>
+---
+ lib/getinfo.c | 47 +++++++++++++++++++++++++----
+ lib/transfer.c | 1 +
+ lib/url.c | 1 +
+ lib/urldata.h | 1 +
+ tests/data/Makefile.am | 2 +-
+ tests/data/test1876 | 67 ++++++++++++++++++++++++++++++++++++++++++
+ 6 files changed, 113 insertions(+), 6 deletions(-)
+ create mode 100644 tests/data/test1876
+
+diff --git a/lib/getinfo.c b/lib/getinfo.c
+index 23f1de270c..eda62da515 100644
+--- a/lib/getinfo.c
++++ b/lib/getinfo.c
+@@ -63,6 +63,7 @@ void Curl_initinfo(struct Curl_easy *data)
+
+ curlx_safefree(info->contenttype);
+ curlx_safefree(info->wouldredirect);
++ curlx_safefree(info->effective_url);
+
+ memset(&info->primary, 0, sizeof(info->primary));
+ info->retry_after = 0;
+@@ -76,15 +77,51 @@ void Curl_initinfo(struct Curl_easy *data)
+ #endif
+ }
+
++static CURLcode effective_url(struct Curl_easy *data,
++ const char **param_charp)
++{
++ const char *s = Curl_bufref_ptr(&data->state.url);
++ *param_charp = s ? s : "";
++ if(s) {
++ char *url = NULL;
++ /* Make a copy of the URL without credentials */
++ CURLU *u = curl_url();
++ CURLUcode uc;
++ if(!u)
++ return CURLE_OUT_OF_MEMORY;
++
++ uc = curl_url_set(u, CURLUPART_URL, s,
++ CURLU_NON_SUPPORT_SCHEME |
++ (data->set.path_as_is ? CURLU_PATH_AS_IS : 0));
++ if(!uc)
++ uc = curl_url_set(u, CURLUPART_USER, NULL, 0);
++ if(!uc)
++ uc = curl_url_set(u, CURLUPART_PASSWORD, NULL, 0);
++ if(!uc)
++ uc = curl_url_get(u, CURLUPART_URL, &url, CURLU_GET_EMPTY);
++
++ curl_url_cleanup(u);
++
++ if(uc || !url)
++ return CURLE_OUT_OF_MEMORY;
++ if(strcmp(url, s)) {
++ /* they are different */
++ curlx_free(data->info.effective_url);
++ data->info.effective_url = url;
++ *param_charp = url;
++ }
++ else
++ curl_free(url);
++ }
++ return CURLE_OK;
++}
++
+ static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info,
+ const char **param_charp)
+ {
+ switch(info) {
+- case CURLINFO_EFFECTIVE_URL: {
+- const char *s = Curl_bufref_ptr(&data->state.url);
+- *param_charp = s ? s : "";
+- }
+- break;
++ case CURLINFO_EFFECTIVE_URL:
++ return effective_url(data, param_charp);
+ case CURLINFO_EFFECTIVE_METHOD: {
+ const char *m = CURL_EASY_STR(data, STRING_CUSTOMREQUEST);
+ if(!m) {
+diff --git a/lib/transfer.c b/lib/transfer.c
+index 3b6c5c03dd..d940f8dc22 100644
+--- a/lib/transfer.c
++++ b/lib/transfer.c
+@@ -503,6 +503,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
+ data->state.authhost.want = data->set.httpauth;
+ data->state.authproxy.want = data->set.proxyauth;
+ curlx_safefree(data->info.wouldredirect);
++ curlx_safefree(data->info.effective_url);
+ Curl_data_priority_clear_state(data);
+ if(data->set.http_auto_referer)
+ Curl_bufref_free(&data->state.referer);
+diff --git a/lib/url.c b/lib/url.c
+index 6eeae43d0d..61126a1d29 100644
+--- a/lib/url.c
++++ b/lib/url.c
+@@ -267,6 +267,7 @@ CURLcode Curl_close(struct Curl_easy **datap)
+ curlx_safefree(data->state.most_recent_ftp_entrypath);
+ curlx_safefree(data->info.contenttype);
+ curlx_safefree(data->info.wouldredirect);
++ curlx_safefree(data->info.effective_url);
+
+ /* No longer a dirty share, if it exists */
+ if(Curl_share_easy_unlink(data))
+diff --git a/lib/urldata.h b/lib/urldata.h
+index 1c0101847b..fb6df8619e 100644
+--- a/lib/urldata.h
++++ b/lib/urldata.h
+@@ -409,6 +409,7 @@ struct PureInfo {
+ curl_off_t numconnects; /* how many new connections libcurl created */
+ char *contenttype; /* the content type of the object */
+ char *wouldredirect; /* URL this would have been redirected to if asked to */
++ char *effective_url; /* when needed */
+ curl_off_t retry_after; /* info from Retry-After: header */
+ const char *conn_scheme;
+ int httpcode; /* Recent HTTP, FTP, RTSP or SMTP response code */
+diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
+index e0ce23abfb..8cdeaf7a0a 100644
+--- a/tests/data/Makefile.am
++++ b/tests/data/Makefile.am
+@@ -1740,7 +1740,7 @@ TESTCASES = \
+ test1849 \
+ test1850 \
+ test1851 \
+- \
++ test1876 \
+ test1900 \
+ test1901 \
+ test1902 \
+diff --git a/tests/data/test1876 b/tests/data/test1876
+new file mode 100644
+index 0000000000..4fc3b9fd02
+--- /dev/null
++++ b/tests/data/test1876
+@@ -0,0 +1,67 @@
++<?xml version="1.0" encoding="US-ASCII"?>
++<testcase>
++<info>
++<keywords>
++netrc
++</keywords>
++</info>
++
++# Server-side
++<reply>
++<data crlf="headers" nocheck="yes">
++HTTP/1.1 301 redir
++Content-Length: 0
++Content-Type: text/html
++Location: %TESTNUMBER0002
++
++</data>
++
++<data2 crlf="headers">
++HTTP/1.1 200 OK
++Content-Length: 0
++Content-Type: text/html
++
++</data2>
++
++</reply>
++
++# Client-side
++<client>
++<server>
++http
++</server>
++<name>
++verify no credentials present in effective URL after redirect
++</name>
++<file name="%LOGDIR/netrc">
++machine %HOSTIP
++login netrcuser
++password netrcSECRET123
++</file>
++
++<command option="no-include">
++http://%HOSTIP:%HTTPPORT/%TESTNUMBER --netrc-optional --netrc-file %LOGDIR/netrc -L -w 'EFFECTIVE_URL=%{url_effective}\n'
++</command>
++</client>
++
++# Verify data after the test has been "shot"
++<verify>
++<protocol crlf="headers">
++GET /%TESTNUMBER HTTP/1.1
++Host: %HOSTIP:%HTTPPORT
++Authorization: Basic %b64[netrcuser:netrcSECRET123]b64%
++User-Agent: curl/%VERSION
++Accept: */*
++
++GET /%TESTNUMBER0002 HTTP/1.1
++Host: %HOSTIP:%HTTPPORT
++Authorization: Basic %b64[netrcuser:netrcSECRET123]b64%
++User-Agent: curl/%VERSION
++Accept: */*
++
++</protocol>
++<stdout>
++EFFECTIVE_URL=http://%HOSTIP:%HTTPPORT/%TESTNUMBER0002
++</stdout>
++</verify>
++</testcase>
@@ -20,6 +20,7 @@ SRC_URI = " \
file://CVE-2026-87865.patch \
file://CVE-2026-92386.patch \
file://CVE-2026-92391.patch \
+ file://CVE-2026-94266.patch \
"
SRC_URI:append:class-nativesdk = " \
This vulnerability, marked as High [1], was fixed upstream [2] since v8.23.0. Backport the fix to curl v8.22.0. [1] https://nvd.nist.gov/vuln/detail/cve-2026-94266 [2] https://curl.se/docs/CVE-2026-94266.html Signed-off-by: João Marcos Costa (Schneider Electric) <joaomarcos.costa@bootlin.com> --- .../curl/curl/CVE-2026-94266.patch | 220 ++++++++++++++++++ meta/recipes-support/curl/curl_8.22.0.bb | 1 + 2 files changed, 221 insertions(+) create mode 100644 meta/recipes-support/curl/curl/CVE-2026-94266.patch