From patchwork Tue Jul 8 08:57:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yurade X-Patchwork-Id: 66391 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7378C8303C for ; Tue, 8 Jul 2025 08:58:02 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web11.14170.1751965076197571446 for ; Tue, 08 Jul 2025 01:57:56 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=9284bb4a79=yogita.urade@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5685P3bO028542 for ; Tue, 8 Jul 2025 01:57:56 -0700 Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [147.11.82.252]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 47pyb5jkh5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 08 Jul 2025 01:57:55 -0700 (PDT) Received: from blr-linux-engg1.wrs.com (147.11.136.210) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.57; Tue, 8 Jul 2025 01:57:39 -0700 From: yurade To: Subject: [OE-core][kirkstone][PATCH 2/2] curl: fix CVE-2025-0167 Date: Tue, 8 Jul 2025 14:27:29 +0530 Message-ID: <20250708085729.365541-2-yogita.urade@windriver.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20250708085729.365541-1-yogita.urade@windriver.com> References: <20250708085729.365541-1-yogita.urade@windriver.com> MIME-Version: 1.0 X-Originating-IP: [147.11.136.210] X-ClientProxiedBy: ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) To ala-exchng01.corp.ad.wrs.com (147.11.82.252) X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzA4MDA3MiBTYWx0ZWRfX6mLmgqEWXimK 8V4/TSWV1l8qi+ApbVr5cetPjxto4bi53hIT8fxkox5/madKaDK9LMeQn/+4U/ynvta/j/FSbZt erXGnUjVMZzWH9+Y/Ebjs99nv1l3dSSpTugEQlztPevJGigCTbR29x2hwoIYWl/aKLikxjVaJKw R7KyYDrbsJrcQKktCwCv4GAn3ac02USlP5Ud5FaQARWoRQU/LsZrLWwBNuIWSiX0TYQDy7RlK/5 SSBVrQ2Jpg5qt2uTkiX9QGJSgt/IOt/HbOAYdzYhKQI8xSXhsjlYGYT+2/JjXkJ3ADG/P9gzdDV 3HwwkojtSETwpTjDJffVpb3gycM1UdEKtrIZZFTVw2FREBfv++2qUUouQlbi/x4op4Dkgf4R7KS Pqc6yB3sIPqz2i8/jUd1DwzuxXyjIxQvRzSK8eMbISBDYY1/LLOr1G8SCBSByDF+FsAt2/9G X-Authority-Analysis: v=2.4 cv=V5590fni c=1 sm=1 tr=0 ts=686cdd93 cx=c_pps a=/ZJR302f846pc/tyiSlYyQ==:117 a=/ZJR302f846pc/tyiSlYyQ==:17 a=HCiNrPZc1L8A:10 a=Wb1JkmetP80A:10 a=PYnjg3YJAAAA:8 a=NEAV23lmAAAA:8 a=yEquWHxyAAAA:8 a=HnMHPIp3AAAA:8 a=ugkhXdxtAAAA:8 a=t7CeM3EgAAAA:8 a=vS14BkTSuA0N-mJl6iEA:9 a=r-HJ9bD__24A:10 a=Wpz8ju6o9T4A:10 a=s5zKW874KtQA:10 a=Ea3xMBwKpvXIEc3eveN9:22 a=_j3XSMEICZ-j_p4bQif0:22 a=j7VXw0cNxiiRp7-5Gr1y:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-ORIG-GUID: dM_r1zU8Xlscw2bVtjVRWE8MyD8eOWCK X-Proofpoint-GUID: dM_r1zU8Xlscw2bVtjVRWE8MyD8eOWCK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-08_02,2025-07-07_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxscore=0 spamscore=0 priorityscore=1501 clxscore=1015 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 impostorscore=0 mlxlogscore=999 lowpriorityscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.21.0-2505280000 definitions=main-2507080072 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 08 Jul 2025 08:58:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/220021 From: Yogita Urade When asked to use a `.netrc` file for credentials *and* to follow HTTP redirects, curl could leak the password used for the first host to the followed-to host under certain circumstances. This flaw only manifests itself if the netrc file has a `default` entry that omits both login and password. A rare circumstance. Reference: https://nvd.nist.gov/vuln/detail/CVE-2025-0167 Upstream patch: https://github.com/curl/curl/commit/0e120c5b925e8ca75d5319e319e5ce4b8080d8eb Signed-off-by: Yogita Urade --- .../curl/curl/CVE-2025-0167.patch | 175 ++++++++++++++++++ meta/recipes-support/curl/curl_7.82.0.bb | 1 + 2 files changed, 176 insertions(+) create mode 100644 meta/recipes-support/curl/curl/CVE-2025-0167.patch diff --git a/meta/recipes-support/curl/curl/CVE-2025-0167.patch b/meta/recipes-support/curl/curl/CVE-2025-0167.patch new file mode 100644 index 0000000000..b803cff0d2 --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2025-0167.patch @@ -0,0 +1,175 @@ +From 0e120c5b925e8ca75d5319e319e5ce4b8080d8eb Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Fri, 3 Jan 2025 16:22:27 +0100 +Subject: [PATCH] netrc: 'default' with no credentials is not a match + +Test 486 verifies. + +Reported-by: Yihang Zhou + +Closes #15908 + +Changes: +- Test files are added in Makefile.inc. +- Adjust `%LOGDIR/` to 'log/' due to its absence in code. + +CVE: CVE-2025-0167 +Upstream-Status: Backport [https://github.com/curl/curl/commit/0e120c5b925e8ca75d5319e319e5ce4b8080d8eb] + +Signed-off-by: Yogita Urade +--- + lib/netrc.c | 7 ++- + tests/data/Makefile.in | 2 + + tests/data/test486 | 105 +++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 113 insertions(+), 1 deletion(-) + create mode 100644 tests/data/test486 + +diff --git a/lib/netrc.c b/lib/netrc.c +index 23080b3..6d87007 100644 +--- a/lib/netrc.c ++++ b/lib/netrc.c +@@ -205,12 +205,17 @@ static int parsenetrc(const char *host, + } /* while fgets() */ + + out: +- if(!retcode && !password && our_login) { ++ if(!retcode) { ++ if(!password && our_login) { + /* success without a password, set a blank one */ + password = strdup(""); + if(!password) + retcode = 1; /* out of memory */ + } ++ else if(!login && !password) ++ /* a default with no credentials */ ++ retcode = NETRC_FILE_MISSING; ++ } + if(!retcode) { + /* success */ + *login_changed = FALSE; +diff --git a/tests/data/Makefile.in b/tests/data/Makefile.in +index 3da7d31..5a3ec48 100644 +--- a/tests/data/Makefile.in ++++ b/tests/data/Makefile.in +@@ -431,6 +431,8 @@ test409 test410 \ + \ + test430 test431 test432 test433 test434 test435 test436 \ + \ ++test486 \ ++\ + test490 test491 test492 test493 test494 \ + \ + test500 test501 test502 test503 test504 test505 test506 test507 test508 \ +diff --git a/tests/data/test486 b/tests/data/test486 +new file mode 100644 +index 0000000..6926092 +--- /dev/null ++++ b/tests/data/test486 +@@ -0,0 +1,105 @@ ++ ++ ++ ++netrc ++HTTP ++ ++ ++# ++# Server-side ++ ++ ++HTTP/1.1 301 Follow this you fool ++Date: Tue, 09 Nov 2010 14:49:00 GMT ++Server: test-server/fake ++Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT ++ETag: "21025-dc7-39462498" ++Accept-Ranges: bytes ++Content-Length: 6 ++Connection: close ++Location: http://b.com/%TESTNUMBER0002 ++ ++-foo- ++ ++ ++ ++HTTP/1.1 200 OK ++Date: Tue, 09 Nov 2010 14:49:00 GMT ++Server: test-server/fake ++Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT ++ETag: "21025-dc7-39462498" ++Accept-Ranges: bytes ++Content-Length: 7 ++Connection: close ++ ++target ++ ++ ++ ++HTTP/1.1 301 Follow this you fool ++Date: Tue, 09 Nov 2010 14:49:00 GMT ++Server: test-server/fake ++Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT ++ETag: "21025-dc7-39462498" ++Accept-Ranges: bytes ++Content-Length: 6 ++Connection: close ++Location: http://b.com/%TESTNUMBER0002 ++ ++HTTP/1.1 200 OK ++Date: Tue, 09 Nov 2010 14:49:00 GMT ++Server: test-server/fake ++Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT ++ETag: "21025-dc7-39462498" ++Accept-Ranges: bytes ++Content-Length: 7 ++Connection: close ++ ++target ++ ++ ++ ++# ++# Client-side ++ ++ ++http ++ ++ ++proxy ++ ++ ++.netrc with redirect and "default" with no password or login ++ ++ ++--netrc --netrc-file log/netrc%TESTNUMBER -L -x http://%HOSTIP:%HTTPPORT/ http://a.com/ ++ ++ ++ ++machine a.com ++ login alice ++ password alicespassword ++ ++default ++ ++ ++ ++ ++ ++ ++GET http://a.com/ HTTP/1.1 ++Host: a.com ++Authorization: Basic %b64[alice:alicespassword]b64% ++User-Agent: curl/%VERSION ++Accept: */* ++Proxy-Connection: Keep-Alive ++ ++GET http://b.com/%TESTNUMBER0002 HTTP/1.1 ++Host: b.com ++User-Agent: curl/%VERSION ++Accept: */* ++Proxy-Connection: Keep-Alive ++ ++ ++ ++ +-- +2.40.0 diff --git a/meta/recipes-support/curl/curl_7.82.0.bb b/meta/recipes-support/curl/curl_7.82.0.bb index f40139418a..623d8a4bc3 100644 --- a/meta/recipes-support/curl/curl_7.82.0.bb +++ b/meta/recipes-support/curl/curl_7.82.0.bb @@ -65,6 +65,7 @@ SRC_URI = "https://curl.se/download/${BP}.tar.xz \ file://CVE-2024-9681.patch \ file://CVE-2024-11053-0001.patch \ file://CVE-2024-11053-0002.patch \ + file://CVE-2025-0167.patch \ " SRC_URI[sha256sum] = "0aaa12d7bd04b0966254f2703ce80dd5c38dbbd76af0297d3d690cdce58a583c"