-
Notifications
You must be signed in to change notification settings - Fork 0
fix(libscram-java): CVE-2025-59432 #1
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
Open
deepin-ci-robot
wants to merge
1
commit into
master
Choose a base branch
from
fix/CVE-2025-59432
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 hidden or 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 |
|---|---|---|
| @@ -1,3 +1,9 @@ | ||
| libscram-java (2.1-1+deepin) unstable; urgency=medium | ||
|
|
||
| * Fix CVE-2025-59432: timing side-channel in SCRAM authentication. | ||
|
|
||
| -- deepin-ci-robot <[email protected]> Mon, 27 Apr 2026 19:34:34 +0800 | ||
|
|
||
| libscram-java (2.1-1) unstable; urgency=medium | ||
|
|
||
| * New upstream version 2.1. | ||
|
|
||
48 changes: 48 additions & 0 deletions
48
debian/patches/CVE-2025-59432-fix-timing-side-channel.patch
This file contains hidden or 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,48 @@ | ||
| From: Security Fix <[email protected]> | ||
| Date: Mon, 27 Apr 2026 11:24:00 +0000 | ||
| Subject: Fix timing side-channel vulnerability in SCRAM authentication | ||
|
|
||
| Replace Arrays.equals() with MessageDigest.isEqual() in ScramFunctions.java | ||
| to prevent timing side-channel attacks during credential verification. | ||
|
|
||
| Arrays.equals() performs a short-circuit comparison that leaks timing | ||
| information, while MessageDigest.isEqual() performs a constant-time | ||
| comparison that is resistant to timing attacks. | ||
|
|
||
| CVE-2025-59432 | ||
| Upstream-fix: https://github.com/ongres/scram/commit/e0b0cf99f05406a0d26682c72fcb5728e95124b3 | ||
|
|
||
| --- | ||
| .../ongres/scram/common/ScramFunctions.java | 5 +++-- | ||
| 1 file changed, 3 insertions(+), 2 deletions(-) | ||
|
|
||
| diff --git a/common/src/main/java/com/ongres/scram/common/ScramFunctions.java b/common/src/main/java/com/ongres/scram/common/ScramFunctions.java | ||
| index 1111111..2222222 100644 | ||
| --- a/common/src/main/java/com/ongres/scram/common/ScramFunctions.java | ||
| +++ b/common/src/main/java/com/ongres/scram/common/ScramFunctions.java | ||
| @@ -28,7 +28,7 @@ package com.ongres.scram.common; | ||
| import com.ongres.scram.common.util.CryptoUtil; | ||
|
|
||
| import java.nio.charset.StandardCharsets; | ||
| -import java.util.Arrays; | ||
| +import java.security.MessageDigest; | ||
|
|
||
| /** | ||
| * Utility functions (e.g. crypto) for SCRAM. | ||
| @@ -231,7 +231,7 @@ public class ScramFunctions { | ||
| byte[] clientKey = CryptoUtil.xor(clientSignature, clientProof); | ||
| byte[] computedStoredKey = hash(scramMechanism, clientKey); | ||
|
|
||
| - return Arrays.equals(storedKey, computedStoredKey); | ||
| + return MessageDigest.isEqual(storedKey, computedStoredKey); | ||
| } | ||
|
|
||
| /** | ||
| @@ -245,6 +245,6 @@ public class ScramFunctions { | ||
| public static boolean verifyServerSignature( | ||
| ScramMechanism scramMechanism, byte[] serverKey, String authMessage, byte[] serverSignature | ||
| ) { | ||
| - return Arrays.equals(serverSignature(scramMechanism, serverKey, authMessage), serverSignature); | ||
| + return MessageDigest.isEqual(serverSignature(scramMechanism, serverKey, authMessage), serverSignature); | ||
| } | ||
| } |
This file contains hidden or 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 @@ | ||
| CVE-2025-59432-fix-timing-side-channel.patch |
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.
版本号规则错误