GHSA-p9jg-fcr6-3mhf

Suggest an improvement
Source
https://github.com/advisories/GHSA-p9jg-fcr6-3mhf
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-p9jg-fcr6-3mhf/GHSA-p9jg-fcr6-3mhf.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-p9jg-fcr6-3mhf
Aliases
Published
2026-07-01T21:51:17Z
Modified
2026-07-01T22:00:08.540273821Z
Severity
  • 8.2 (High) CVSS_V4 - CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:L/SA:N CVSS Calculator
Summary
OnGres SCRAM silent channel-binding authentication downgrade via unsupported certificate algorithms
Details

Summary

A flaw in com.ongres.scram:scram-client allows an attacker capable of performing a TLS man-in-the-middle (MITM) attack to silently downgrade a connection from SCRAM-SHA-256-PLUS (with channel binding) to standard SCRAM-SHA-256 (without channel binding), bypassing strict client-side enforcement policies.

Component Breakdown

This occurs due to a two-part failure in TlsServerEndpoint when a server presents an X.509 certificate using a modern signature algorithm that lacks traditional WITH naming structures (such as Ed25519 or post-quantum algorithms):

  1. The internal hash derivation method fails to parse the algorithm name, swallows the resulting NoSuchAlgorithmException, and silently returns an empty byte array via the deprecatedgetChannelBindingData()` API.
  2. The client builder mistakenly interprets this empty byte array as an environmental absence of channel binding data rather than a cryptographic failure, falling back to non-channel-bound authentication.

Impact & Scope

This issue only impacts deployments where the downstream application layer explicitly enforces strict channel binding enforcement (e.g., channelBinding=require in pgJDBC).

Drivers operating under a "prefer" or "allow" policy (used by default) are structurally insulated from an unhandled exception since a fallback to standard SCRAM is within their expected configuration.

Remediation

Update your project configuration to pull in version 3.3 or later of the SCRAM library, which introduces strict exception propagation and explicit policy controls.

If you are interacting with the ScramClient builder API directly (e.g., writing a custom driver or database extension):

  • Migrate Deprecated APIs: Stop using TlsServerEndpoint.getChannelBindingData(). Transition immediately to TlsServerEndpoint.getChannelBindingHash(), which correctly propagates NoSuchAlgorithmException up the stack.
  • Adopt Explicit Policies: Leverage the newly introduced ChannelBindingPolicy API during client construction. Do not rely on implicit parameter presence to dictate your security boundaries.
ScramClient client = ScramClient.builder()
    .advertisedMechanisms(serverMechanisms)
    .username(user)
    .password(pass)
    // Explicitly enforce strict boundaries if needed.
    .channelBindingPolicy(ChannelBindingPolicy.REQUIRE) 
    .channelBinding(TlsServerEndpoint.TLS_SERVER_END_POINT, certHash)
    .build();
Database specific
{
    "cwe_ids": [
        "CWE-636",
        "CWE-757"
    ],
    "github_reviewed": true,
    "severity": "HIGH",
    "github_reviewed_at": "2026-07-01T21:51:17Z",
    "nvd_published_at": null
}
References

Affected packages

Maven / com.ongres.scram:scram-client

Package

Name
com.ongres.scram:scram-client
View open source insights on deps.dev
Purl
pkg:maven/com.ongres.scram/scram-client

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.3

Affected versions

3.*
3.0
3.1
3.2

Database specific

last_known_affected_version_range
"<= 3.2"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-p9jg-fcr6-3mhf/GHSA-p9jg-fcr6-3mhf.json"

Maven / com.ongres.scram:scram-common

Package

Name
com.ongres.scram:scram-common
View open source insights on deps.dev
Purl
pkg:maven/com.ongres.scram/scram-common

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.3

Affected versions

3.*
3.0
3.1
3.2

Database specific

last_known_affected_version_range
"<= 3.2"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-p9jg-fcr6-3mhf/GHSA-p9jg-fcr6-3mhf.json"