-
Notifications
You must be signed in to change notification settings - Fork 596
[AutoPR- Security] Patch openssh for CVE-2025-61985, CVE-2025-61984 [LOW] #14827
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
base: 3.0-dev
Are you sure you want to change the base?
[AutoPR- Security] Patch openssh for CVE-2025-61985, CVE-2025-61984 [LOW] #14827
Conversation
Updated release number and added patches for CVE-2025-61984 and CVE-2025-61985.
Updated version number and added patch for CVE-2025-61985 and CVE-2025-61984.
SPECS/openssh/CVE-2025-61984.patch
Outdated
characters in url-encoded strings. Suggested by David Leadbeater, ok deraadt@ | ||
|
||
Signed-off-by: Azure Linux Security Servicing Account <[email protected]> | ||
Upstream-reference: AI Backport of https://github.com/openssh/openssh-portable/commit/43b3bff47bb029f2299bacb6a36057981b39fdb0.patch |
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.
This fix is for CVE-2025-61985, would request for swapping the patch filenames. This patch looks fine.
SPECS/openssh/CVE-2025-61985.patch
Outdated
if (isspace((u_char)s[i]) && s[i + 1] == '-') | ||
return 0; | ||
- /* Disallow \ in last position */ | ||
+ /* Disallow \\ in last position */ |
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.
This comment change not required
SPECS/openssh/CVE-2025-61985.patch
Outdated
if (*s == '-') | ||
return 0; | ||
for (i = 0; s[i] != 0; i++) { | ||
+ if (iscntrl((u_char)s[i])) |
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.
Only change in valid_ruser() looks sufficient to fix CVE-2025-61984. Rest all changes are not required as we are not expanding user in the openssh-9.8p1 version.
SPECS/openssh/CVE-2025-61985.patch
Outdated
struct ssh *ssh = NULL; | ||
int i, r, opt, exit_status, use_syslog, direct, timeout_ms; | ||
int was_addr, config_test = 0, opt_terminated = 0, want_final_pass = 0; | ||
+ int user_on_commandline = 0, user_was_default = 0, user_expanded = 0; |
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.
As per my understanding the changes in main() in ssh,c and macro in sshconnect.h not required.
if (*s == '-') | ||
return 0; | ||
for (i = 0; s[i] != 0; i++) { | ||
+ if (iscntrl((u_char)s[i])) |
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.
As per the CVE description,
ssh in OpenSSH allows control characters in usernames that originate from certain possibly untrusted sources, potentially leading to code execution when a ProxyCommand is used. The untrusted sources are the command line and %-sequence expansion of a configuration file.
(A configuration file that provides a complete literal username is not categorized as an untrusted source.)
. As we haven't changed,
if (!valid_ruser(options.user))
fatal("remote username contains invalid characters");
Shouldn't we check the same way as it was done in the upstream patch like when user_expanded
is not true, then we should allow that username?
if ((user_on_commandline || user_expanded) &&
!valid_ruser(options.user))
fatal("remote username contains invalid characters");
Which will allow complete literal username from configuration file. Or, @mayankfz, as per your analysis, that will be taken care by iscntrl((u_char)s[i])
itself?
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.
In the present code we are not expanding username, so that's why we do not need to use that code only, this code would have been introduced in some later version, so that's why we do not need the complete code. These changes are to only expand trusted sources only but we are not expanding in the current version, so in my opinion, changes are not required, only the valid_ruser will take care of it.
Auto Patch openssh for CVE-2025-61985, CVE-2025-61984.
Autosec pipeline run -> https://dev.azure.com/mariner-org/mariner-chatbot/_build/results?buildId=947824&view=results
Merge Checklist
All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)
*-static
subpackages, etc.) have had theirRelease
tag incremented../cgmanifest.json
,./toolkit/scripts/toolchain/cgmanifest.json
,.github/workflows/cgmanifest.json
)./LICENSES-AND-NOTICES/SPECS/data/licenses.json
,./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md
,./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON
)*.signatures.json
filessudo make go-tidy-all
andsudo make go-test-coverage
passSummary
What does the PR accomplish, why was it needed?
Change Log
Does this affect the toolchain?
YES/NO
Associated issues
Links to CVEs
Test Methodology