Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Yoann Congal" <yoann.congal@smile.fr>
To: <devanshp@cisco.com>, <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-Core][scarthgap][PATCH 1/4] curl: Fix CVE-2026-8927
Date: Tue, 24 Nov 2026 12:27:27 +0100	[thread overview]
Message-ID: <DN3ELESNX6PF.3L73PUZP0X5PE@smile.fr> (raw)
In-Reply-To: <20261120130414.822854-2-devanshp@cisco.com>

On Fri Nov 20, 2026 at 2:04 PM CET, Devansh Patel via openembedded-core wrote:
> From: Devansh Patel <devanshp@cisco.com>
>
> This patch applies the upstream fix commit as referenced in [1],
> and the public CVE advisory is referenced in [2].
>
> [1] https://github.com/curl/curl/commit/5c225384b8d52c67ce8259c6e4203bc57aacb567
> [2] https://curl.se/docs/CVE-2026-8927.html
> [3] https://www.cve.org/CVERecord?id=CVE-2026-8927
>
> Signed-off-by: Devansh Patel <devanshp@cisco.com>
> ---
>  .../curl/curl/CVE-2026-8927.patch             | 87 +++++++++++++++++++
>  meta/recipes-support/curl/curl_8.7.1.bb       |  1 +
>  2 files changed, 88 insertions(+)
>  create mode 100644 meta/recipes-support/curl/curl/CVE-2026-8927.patch
>
> diff --git a/meta/recipes-support/curl/curl/CVE-2026-8927.patch b/meta/recipes-support/curl/curl/CVE-2026-8927.patch
> new file mode 100644
> index 0000000..a8b07a5
> --- /dev/null
> +++ b/meta/recipes-support/curl/curl/CVE-2026-8927.patch
> @@ -0,0 +1,87 @@
> +From d4e71ad3aed07542606d9c4afdf6884eccdb3a26 Mon Sep 17 00:00:00 2001
> +From: Daniel Stenberg <daniel@haxx.se>
> +Date: Mon, 18 May 2026 23:47:11 +0200
> +Subject: [PATCH] url: detect proxy changes read from environment
> +
> +When a proxy is set from an environment variable, detect if that proxy
> +is not the same as previously and flush state.
> +
> +Verified by test1647: verify changing proxy with env variables and make
> +sure Digest state is flushed in the second use
> +
> +Closes #21666
> +
> +CVE: CVE-2026-8927
> +Upstream-Status: Backport [https://github.com/curl/curl/commit/5c225384b8d52c67ce8259c6e4203bc57aacb567]
> +
> +Backport Changes:
> +- Use the 8.7.1 free()/strdup() names and include vauth/vauth.h.
> +  Keep the parsed proxy string until the existing out cleanup so the
> +  upstream Digest-state comparison can still read it.
> +- Omit tests/data/Makefile.am, tests/data/test1647,
> +  tests/libtest/Makefile.inc and tests/libtest/lib1647.c.
> +  The test-only feature-detection dependency is therefore unnecessary.
> +
> +Signed-off-by: Devansh Patel <devanshp@cisco.com>
> +---
> + lib/url.c     | 13 ++++++++++++-
> + lib/urldata.h |  1 +
> + 2 files changed, 13 insertions(+), 1 deletion(-)
> +
> +diff --git a/lib/url.c b/lib/url.c
> +index 9e1ca03..fe76397 100644
> +--- a/lib/url.c
> ++++ b/lib/url.c
> +@@ -79,6 +79,7 @@
> + #include "share.h"
> + #include "content_encoding.h"
> + #include "http_digest.h"
> ++#include "vauth/vauth.h"
> + #include "http_negotiate.h"
> + #include "select.h"
> + #include "multiif.h"
> +@@ -331,6 +332,9 @@ CURLcode Curl_close(struct Curl_easy **datap)
> +   Curl_wildcard_dtor(&data->wildcard);
> +   Curl_freeset(data);
> +   Curl_headers_cleanup(data);
> ++#ifndef CURL_DISABLE_DIGEST_AUTH
> ++  free(data->state.envproxy);
> ++#endif
> +   free(data);
> +   return CURLE_OK;
> + }
> +@@ -2535,7 +2539,6 @@ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data,
> +     curl_proxytype ptype = (curl_proxytype)conn->http_proxy.proxytype;
> +     if(proxy) {
> +       result = parse_proxy(data, conn, proxy, ptype);
> +-      Curl_safefree(proxy); /* parse_proxy copies the proxy string */

This removed line is not in upstream patch. Are you sure you don't want
to move it instead? Removing a free() sounds like a memory leak...

> +       if(result)
> +         goto out;
> +     }
> +@@ -2554,6 +2557,14 @@ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data,
> +       result = CURLE_UNSUPPORTED_PROTOCOL;
> +       goto out;
> + #else
> ++#ifndef CURL_DISABLE_DIGEST_AUTH
> ++      if(!Curl_safecmp(data->state.envproxy, proxy)) {
> ++        /* proxy changed */
> ++        Curl_auth_digest_cleanup(&data->state.proxydigest);
> ++        free(data->state.envproxy);
> ++        data->state.envproxy = strdup(proxy);

Have you checked that proxy can't be NULL here (on curl 8.7.1)?

My review LLM wrote that it could and that sounds plausible to me:
| Warning: The guard is different. 8.7.1 tests
| `conn->http_proxy.host.rawalloc` where upstream tests
| `conn->http_proxy.peer`.
| 
| Upstream always parses the pre-proxy into socks_proxy, so `proxy` is
| never NULL at that point.
| 
| In 8.7.1, parse_proxy() puts a schemeless CURLOPT_PRE_PROXY
| ("host:1080", scheme guessed as http, default PROXYTYPE) into http_proxy
| and leaves `proxy` NULL. If the same handle used an HTTP proxy earlier,
| Curl_safecmp(envproxy, NULL) returns false, the code calls strdup(NULL)
| and segfaults.

Can you check please?

Regards,
-- 
Yoann Congal
Smile ECS


  reply	other threads:[~2026-11-24 11:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 13:04 [OE-Core][scarthgap][PATCH 0/4] curl: fix CVE-2026-8927, CVE-2026-8932, CVE-2026-6429 and CVE-2026-7168 Devansh Patel -X (devanshp - E INFOCHIPS PRIVATE LIMITED at Cisco)
2026-11-20 13:04 ` [OE-Core][scarthgap][PATCH 1/4] curl: Fix CVE-2026-8927 Devansh Patel -X (devanshp - E INFOCHIPS PRIVATE LIMITED at Cisco)
2026-11-24 11:27   ` Yoann Congal [this message]
2026-11-27  8:45     ` Devansh Patel -X (devanshp - E INFOCHIPS PRIVATE LIMITED at Cisco)
2026-11-27  8:47       ` [scarthgap][PATCH " Devansh Patel
2026-11-20 13:04 ` [OE-Core][scarthgap][PATCH 2/4] curl: Fix CVE-2026-8932 Devansh Patel -X (devanshp - E INFOCHIPS PRIVATE LIMITED at Cisco)
2026-11-24 18:03   ` Yoann Congal
2026-11-20 13:04 ` [OE-Core][scarthgap][PATCH 3/4] curl: Fix CVE-2026-6429 Devansh Patel -X (devanshp - E INFOCHIPS PRIVATE LIMITED at Cisco)
2026-11-24 18:31   ` Yoann Congal
2026-11-20 13:04 ` [OE-Core][scarthgap][PATCH 4/4] curl: Fix CVE-2026-7168 Devansh Patel -X (devanshp - E INFOCHIPS PRIVATE LIMITED at Cisco)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DN3ELESNX6PF.3L73PUZP0X5PE@smile.fr \
    --to=yoann.congal@smile.fr \
    --cc=devanshp@cisco.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox