CVE-2025-59432
Description
SCRAM (Salted Challenge Response Authentication Mechanism) is part of the family of Simple Authentication and Security Layer (SASL, RFC 4422) authentication mechanisms. Prior to version 3.2, a timing attack vulnerability exists in the SCRAM Java implementation. The issue arises because Arrays.equals was used to compare secret values such as client proofs and server signatures. Since Arrays.equals performs a short-circuit comparison, the execution time varies depending on how many leading bytes match. This behavior could allow an attacker to perform a timing side-channel attack and potentially infer sensitive authentication material. All users relying on SCRAM authentication are impacted. This vulnerability has been patched in version 3.1 by replacing Arrays.equals with MessageDigest.isEqual, which ensures constant-time comparison.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
com.ongres.scram:scram-commonMaven | < 3.2 | 3.2 |
Affected products
1Patches
2b404a64e125erelease: SCRAM Java 3.2
7 files changed · +18 −9
CHANGELOG.md+10 −1 modified@@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +## [3.2] - 2025-09-16 +### :lock: Security +- Fix Timing Attack Vulnerability in SCRAM Authentication + +### :ghost: Maintenance +- Updated dependencies and maven plugins. +- Use `central-publishing-maven-plugin` to deploy to Maven Central. + ## [3.1] - 2024-06-26 ### :building_construction: Improvements - Ensure the `LICENSE` file is included in the Jar file. @@ -38,4 +46,5 @@ All notable changes to this project will be documented in this file. [3.0]: https://github.com/ongres/scram/compare/2.1...3.0 [3.1]: https://github.com/ongres/scram/compare/3.0...3.1 -[Unreleased]: https://github.com/ongres/scram/compare/3.1...main +[3.2]: https://github.com/ongres/scram/compare/3.1...3.2 +[Unreleased]: https://github.com/ongres/scram/compare/3.2...main
coverage-report/pom.xml+1 −1 modified@@ -5,7 +5,7 @@ <parent> <groupId>com.ongres.scram</groupId> <artifactId>scram-parent</artifactId> - <version>3.2-SNAPSHOT</version> + <version>3.2</version> <relativePath>../scram-parent/pom.xml</relativePath> </parent>
pom.xml+1 −1 modified@@ -5,7 +5,7 @@ <parent> <groupId>com.ongres.scram</groupId> <artifactId>scram-parent</artifactId> - <version>3.3-SNAPSHOT</version> + <version>3.2</version> <relativePath>scram-parent/pom.xml</relativePath> </parent>
scram-client/pom.xml+1 −1 modified@@ -5,7 +5,7 @@ <parent> <groupId>com.ongres.scram</groupId> <artifactId>scram-parent</artifactId> - <version>3.3-SNAPSHOT</version> + <version>3.2</version> <relativePath>../scram-parent/pom.xml</relativePath> </parent>
scram-client/src/it/jpms-scram-client/pom.xml+1 −1 modified@@ -7,7 +7,7 @@ <groupId>com.ongres.scram.it</groupId> <artifactId>jpms-scram-client</artifactId> <name>JPMS Scram Client</name> - <version>3.2-SNAPSHOT</version> + <version>3.2</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
scram-common/pom.xml+1 −1 modified@@ -5,7 +5,7 @@ <parent> <groupId>com.ongres.scram</groupId> <artifactId>scram-parent</artifactId> - <version>3.3-SNAPSHOT</version> + <version>3.2</version> <relativePath>../scram-parent/pom.xml</relativePath> </parent>
scram-parent/pom.xml+3 −3 modified@@ -4,7 +4,7 @@ <groupId>com.ongres.scram</groupId> <artifactId>scram-parent</artifactId> - <version>3.3-SNAPSHOT</version> + <version>3.2</version> <packaging>pom</packaging> <name>SCRAM - Parent</name> @@ -44,7 +44,7 @@ <scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false"> <connection>scm:git:https://github.com/ongres/scram.git</connection> <developerConnection>scm:git:git@github.com:ongres/scram.git</developerConnection> - <tag>HEAD</tag> + <tag>3.2</tag> <url>https://github.com/ongres/scram</url> </scm> @@ -59,7 +59,7 @@ <base.java.version>8</base.java.version> <maven.compiler.source>${base.java.version}</maven.compiler.source> <maven.compiler.target>${base.java.version}</maven.compiler.target> - <project.build.outputTimestamp>2025-09-16T19:29:12Z</project.build.outputTimestamp> + <project.build.outputTimestamp>2025-09-16T20:00:00Z</project.build.outputTimestamp> <!-- Dependency versions --> <jetbrains-annotations.version>26.0.2-1</jetbrains-annotations.version> <junit5.version>5.13.4</junit5.version>
e0b0cf99f054fix(security): Timing Attack Vulnerability
3 files changed · +9 −4
checks/forbiddenapis.txt+2 −0 added@@ -0,0 +1,2 @@ + +java.util.Arrays#equals(byte[],byte[]) @ Replace with java.security.MessageDigest#isEqual(byte[],byte[])
scram-common/src/main/java/com/ongres/scram/common/ScramFunctions.java+4 −4 modified@@ -7,8 +7,8 @@ import static java.nio.charset.StandardCharsets.UTF_8; +import java.security.MessageDigest; import java.security.SecureRandom; -import java.util.Arrays; import com.ongres.scram.common.util.Preconditions; import org.jetbrains.annotations.NotNull; @@ -190,8 +190,7 @@ public static boolean verifyClientProof( byte[] clientSignature = clientSignature(scramMechanism, storedKey, authMessage); byte[] clientKey = CryptoUtil.xor(clientSignature, clientProof); byte[] computedStoredKey = hash(scramMechanism, clientKey); - - return Arrays.equals(storedKey, computedStoredKey); + return MessageDigest.isEqual(storedKey, computedStoredKey); } /** @@ -205,7 +204,8 @@ public static boolean verifyClientProof( */ public static boolean verifyServerSignature( ScramMechanism scramMechanism, byte[] serverKey, String authMessage, byte[] serverSignature) { - return Arrays.equals(serverSignature(scramMechanism, serverKey, authMessage), serverSignature); + byte[] computedServerSignature = serverSignature(scramMechanism, serverKey, authMessage); + return MessageDigest.isEqual(serverSignature, computedServerSignature); } /**
scram-parent/pom.xml+3 −0 modified@@ -530,6 +530,9 @@ <!-- don't allow System.out or System.err: --> <bundledSignature>jdk-system-out</bundledSignature> </bundledSignatures> + <signaturesFiles> + <signaturesFile>${checks.location}/forbiddenapis.txt</signaturesFile> + </signaturesFiles> </configuration> <executions> <execution>
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-3wfh-36rx-9537ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-59432ghsaADVISORY
- docs.oracle.com/en/java/javase/25/docs/api/java.base/java/security/MessageDigest.htmlnvdWEB
- github.com/ongres/scram/commit/e0b0cf99f05406a0d26682c72fcb5728e95124b3nvdWEB
- github.com/ongres/scram/security/advisories/GHSA-3wfh-36rx-9537nvdWEB
News mentions
0No linked articles in our index yet.