-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patch CVE-2023-27533 in cmake #10467
Closed
+69
−5
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
From 7aee1a49cb796ad199f02746222808d3313fbe9b Mon Sep 17 00:00:00 2001 | ||
From: Suresh Thelkar <[email protected]> | ||
Date: Tue, 17 Sep 2024 12:38:59 +0530 | ||
Subject: [PATCH] Backporting patch for CVE-2023-27533 | ||
|
||
Upstream patch details are given below. | ||
https://github.com/curl/curl/pull/10728/commits | ||
--- | ||
Utilities/cmcurl/lib/telnet.c | 21 +++++++++++++++++++++ | ||
1 file changed, 21 insertions(+) | ||
|
||
diff --git a/Utilities/cmcurl/lib/telnet.c b/Utilities/cmcurl/lib/telnet.c | ||
index fdd137fb..c8af4c95 100644 | ||
--- a/Utilities/cmcurl/lib/telnet.c | ||
+++ b/Utilities/cmcurl/lib/telnet.c | ||
@@ -770,6 +770,17 @@ static void printsub(struct Curl_easy *data, | ||
} | ||
} | ||
|
||
+static bool str_is_nonascii(const char *str) | ||
+{ | ||
+ size_t len = strlen(str); | ||
+ while(len--) { | ||
+ if(*str & 0x80) | ||
+ return TRUE; | ||
+ str++; | ||
+ } | ||
+ return FALSE; | ||
+} | ||
+ | ||
static CURLcode check_telnet_options(struct Curl_easy *data) | ||
{ | ||
struct curl_slist *head; | ||
@@ -784,6 +795,8 @@ static CURLcode check_telnet_options(struct Curl_easy *data) | ||
/* Add the user name as an environment variable if it | ||
was given on the command line */ | ||
if(conn->bits.user_passwd) { | ||
+ if(str_is_nonascii(conn->user)) | ||
+ return CURLE_BAD_FUNCTION_ARGUMENT; | ||
msnprintf(option_arg, sizeof(option_arg), "USER,%s", conn->user); | ||
beg = curl_slist_append(tn->telnet_vars, option_arg); | ||
if(!beg) { | ||
@@ -796,6 +809,14 @@ static CURLcode check_telnet_options(struct Curl_easy *data) | ||
} | ||
|
||
for(head = data->set.telnet_options; head; head = head->next) { | ||
+ char *option = head->data; | ||
+ char *arg; | ||
+ char *sep = strchr(option, '='); | ||
+ if(sep) { | ||
+ arg = ++sep; | ||
+ if(str_is_nonascii(arg)) | ||
+ continue; | ||
+ } | ||
if(sscanf(head->data, "%127[^= ]%*[ =]%255s", | ||
option_keyword, option_arg) == 2) { | ||
|
||
-- | ||
2.34.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
Summary: Cmake | ||
Name: cmake | ||
Version: 3.21.4 | ||
Release: 11%{?dist} | ||
Release: 12%{?dist} | ||
License: BSD AND LGPLv2+ | ||
Vendor: Microsoft Corporation | ||
Distribution: Mariner | ||
|
@@ -21,6 +21,7 @@ Patch6: CVE-2023-38545.patch | |
Patch7: CVE-2023-38546.patch | ||
Patch8: cve-2023-44487.patch | ||
Patch9: CVE-2023-28320.patch | ||
Patch10: CVE-2023-27533.patch | ||
BuildRequires: bzip2 | ||
BuildRequires: bzip2-devel | ||
BuildRequires: curl | ||
|
@@ -86,6 +87,9 @@ bin/ctest --force-new-ctest-process --rerun-failed --output-on-failure | |
%{_prefix}/doc/%{name}-*/* | ||
|
||
%changelog | ||
* Tue Sep 17 2024 Suresh Thelkar <[email protected]> - 3.21.4-12 | ||
- Patch CVE-2023-27533 | ||
|
||
* Fri Jul 26 2024 Zhichun Wan <[email protected]> - 3.21.4-11 | ||
- Patch CVE-2023-28320.patch | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about CVE-2023-27534?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jslobodzian. I have taken this PR changes into #10484 and hence closing this PR.