Vulnerability GHSA-w3jg-pjxf-73p4

Medium Risk
MEDIUM RISK
CVSS Score: 4.3
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
7 hours ago
September 30, 2026 at 11:26 PM UTC
Russh: Missing X25519 zero-point validation in hybrid ML-KEM key exchange
0.34.0 and 0.36.0 - 0.36.2 and 0.37.1 and 0.38.0 and 0.39.0 - 0.40.2 and 0.42.0 and 0.43.0 and 0.44.0 - 0.45.0 and 0.46.0 and 0.48.0 - 0.49.2 and 0.50.0 - 0.50.4 and 0.51.0 - 0.51.1 and 0.52.0 - 0.52.1 and 0.53.0 - 0.62.7
0.34.0 and 0.36.0 - 0.36.2 and 0.37.1 and 0.38.0 and 0.39.0 - 0.40.2 and 0.42.0 and 0.43.0 and 0.44.0 - 0.45.0 and 0.46.0 and 0.48.0 - 0.49.2 and 0.50.0 - 0.50.4 and 0.51.0 - 0.51.1 and 0.52.0 - 0.52.1 and 0.53.0 - 0.62.7

Summary

Russh: Missing X25519 zero-point validation in hybrid ML-KEM key exchange

Details

Vulnerability

The hybrid ML-KEM 768 + X25519 key exchange implementation in russh/src/kex/hybrid_mlkem.rs does not validate that the remote peer's X25519 public key is not the zero point (all-zero 32-byte value). This allows a remote peer to force the X25519 contribution to the combined shared secret to zero, reducing the hybrid KEX to a single-algorithm exchange.

Affected code at HEAD (v0.62.4, commit 0089c89):

Server-side (server_dh, lines 92-93):

let mut c_pk1 = MontgomeryPoint([0; 32]);
c_pk1.0.copy_from_slice(c_pk1_bytes);
// No zero-point check - proceeds to: let k_cl = s_secret * c_pk1;

Client-side (compute_shared_secret, lines 154-155):

let mut s_pk1 = MontgomeryPoint([0; 32]);
s_pk1.0.copy_from_slice(s_pk1_bytes);
// No zero-point check - proceeds to: let k_cl = x25519_secret * s_pk1;

Root Cause

Commit a7fc1eb (2026-07-22, "fix mpint encoding and validate curve25519 keys") added zero-point validation to the standalone Curve25519 KEX in russh/src/kex/curve25519.rs at two locations:

  • server_dh line 77: if client_pubkey.0 == [0u8; 32] { return Err(crate::Error::Kex); }
  • compute_shared_secret line 122: if remote_pubkey.0 == [0u8; 32] { return Err(crate::Error::Kex); }

The same X25519 scalar multiplication pattern appears in hybrid_mlkem.rs, but the fix was not applied there.

Proof of Concept

A malicious SSH client negotiating mlkem768x25519-sha256 can send a KEX_HYBRID_INIT message containing a valid ML-KEM 768 encapsulation key followed by 32 zero bytes as the X25519 component.

When the server computes k_cl = s_secret * c_pk1, the result is the zero point regardless of the server's secret scalar. The combined shared secret K = SHA-256(k_pq || k_cl) then depends only on the ML-KEM component. The same attack works in reverse against a client connecting to a malicious server.

The zero X25519 public key passes all existing validation (the length check on line 78 succeeds since 32 bytes is correct). No panic or crash occurs - the exchange completes successfully with a weakened shared secret.

Impact

The purpose of hybrid key exchange is defense-in-depth: if either the classical algorithm (X25519) or the post-quantum algorithm (ML-KEM 768) is broken, the combined secret remains secure. By injecting a zero X25519 public key, an attacker eliminates the classical contribution entirely, reducing security to depend solely on ML-KEM.

This matters in two scenarios:

  1. If ML-KEM 768 is later found to have a weakness (the explicit threat model hybrid KEX is designed to mitigate), sessions where the X25519 component was zeroed out lose their fallback protection.
  2. An active network attacker who can intercept KEX could downgrade the hybrid exchange to effectively single-algorithm security without either peer detecting it.

The severity is MEDIUM rather than HIGH because the ML-KEM component still provides strong security today, and an active attacker who can modify KEX messages can already perform other attacks unless strict KEX is negotiated.

Suggested Fix

Add zero-point checks in hybrid_mlkem.rs matching the ones in curve25519.rs:

// In server_dh, after line 93:
let mut c_pk1 = MontgomeryPoint([0; 32]);
c_pk1.0.copy_from_slice(c_pk1_bytes);
if c_pk1.0 == [0u8; 32] {
    return Err(Error::Kex);
}

// In compute_shared_secret, after line 155:
let mut s_pk1 = MontgomeryPoint([0; 32]);
s_pk1.0.copy_from_slice(s_pk1_bytes);
if s_pk1.0 == [0u8; 32] {
    return Err(Error::Kex);
}

Ideally, also validate against the other small-subgroup points on Curve25519 (there are a small number of low-order points that also yield a zero shared secret), matching the comprehensive validation OpenSSH performs.

AI tooling

AI assistancewas used for the code audit and for drafting this report. The finding was manually verified against the project's source at the location cited above before reporting it, and the severity and impact assessment are my own.

Related Vulnerabilities

Other vulnerabilities affecting the same packages

Medium Risk
7 hours ago
Russh: Unbounded memory exhaustion via CHANNEL_OPEN flood during a client-stalled rekey
0.34.0 and 0.36.0 - 0.36.2 and 0.37.1 and 0.38.0 and 0.39.0 - 0.40.2 and 0.42.0 and 0.43.0 and 0.44.0 - 0.45.0 and 0.46.0 and 0.48.0 - 0.49.2 and 0.50.0 - 0.50.4 and 0.51.0 - 0.51.1 and 0.52.0 - 0.52.1 and 0.53.0 - 0.62.7 and 0.63.0 - 0.63.1 GHSA-35g8-35p8-c8fw
0.34.0 and 0.36.0 - 0.36.2 and 0.37.1 and 0.38.0 and 0.39.0 - 0.40.2 and 0.42.0 and 0.43.0 and 0.44.0 - 0.45.0 and 0.46.0 and 0.48.0 - 0.49.2 and 0.50.0 - 0.50.4 and 0.51.0 - 0.51.1 and 0.52.0 - 0.52.1 and 0.53.0 - 0.62.7 and 0.63.0 - 0.63.1 GHSA-35g8-35p8-c8fw
Low Risk
7 hours ago
russh: negotiating a MAC-requiring block cipher (CTR/CBC) with mac=none causes a slice-index-out-of-range panic
0.34.0 and 0.36.0 - 0.36.2 and 0.37.1 and 0.38.0 and 0.39.0 - 0.40.2 and 0.42.0 and 0.43.0 and 0.44.0 - 0.45.0 and 0.46.0 and 0.48.0 - 0.49.2 and 0.50.0 - 0.50.4 and 0.51.0 - 0.51.1 and 0.52.0 - 0.52.1 and 0.53.0 - 0.62.7 and 0.63.0 GHSA-p8qx-h547-fjw9
0.34.0 and 0.36.0 - 0.36.2 and 0.37.1 and 0.38.0 and 0.39.0 - 0.40.2 and 0.42.0 and 0.43.0 and 0.44.0 - 0.45.0 and 0.46.0 and 0.48.0 - 0.49.2 and 0.50.0 - 0.50.4 and 0.51.0 - 0.51.1 and 0.52.0 - 0.52.1 and 0.53.0 - 0.62.7 and 0.63.0 GHSA-p8qx-h547-fjw9
High Risk
7 hours ago
russh: Client-side channel-scoped Handler callbacks fire for channel IDs the client never opened
0.34.0 and 0.36.0 - 0.36.2 and 0.37.1 and 0.38.0 and 0.39.0 - 0.40.2 and 0.42.0 and 0.43.0 and 0.44.0 - 0.45.0 and 0.46.0 and 0.48.0 - 0.49.2 and 0.50.0 - 0.50.4 and 0.51.0 - 0.51.1 and 0.52.0 - 0.52.1 and 0.53.0 - 0.62.7 and 0.63.0 GHSA-47hw-gvq5-r2gm
0.34.0 and 0.36.0 - 0.36.2 and 0.37.1 and 0.38.0 and 0.39.0 - 0.40.2 and 0.42.0 and 0.43.0 and 0.44.0 - 0.45.0 and 0.46.0 and 0.48.0 - 0.49.2 and 0.50.0 - 0.50.4 and 0.51.0 - 0.51.1 and 0.52.0 - 0.52.1 and 0.53.0 - 0.62.7 and 0.63.0 GHSA-47hw-gvq5-r2gm
Low Risk
7 hours ago
Russh: Configured server auth-attempt cap is not enforced in the USERAUTH_REQUEST runtime path
0.34.0 and 0.36.0 - 0.36.2 and 0.37.1 and 0.38.0 and 0.39.0 - 0.40.2 and 0.42.0 and 0.43.0 and 0.44.0 - 0.45.0 and 0.46.0 and 0.48.0 - 0.49.2 and 0.50.0 - 0.50.4 and 0.51.0 - 0.51.1 and 0.52.0 - 0.52.1 and 0.53.0 - 0.62.5 GHSA-g6xm-f9xp-qq35
0.34.0 and 0.36.0 - 0.36.2 and 0.37.1 and 0.38.0 and 0.39.0 - 0.40.2 and 0.42.0 and 0.43.0 and 0.44.0 - 0.45.0 and 0.46.0 and 0.48.0 - 0.49.2 and 0.50.0 - 0.50.4 and 0.51.0 - 0.51.1 and 0.52.0 - 0.52.1 and 0.53.0 - 0.62.5 GHSA-g6xm-f9xp-qq35
Medium Risk
1 month ago
Russh: Channel-scoped server callbacks can be reached without an open channel
0.34.0 and 0.36.0 - 0.36.2 and 0.37.1 and 0.38.0 and 0.39.0 - 0.40.2 and 0.42.0 and 0.43.0 and 0.44.0 - 0.45.0 and 0.46.0 and 0.48.0 - 0.49.2 and 0.50.0 - 0.50.4 and 0.51.0 - 0.51.1 and 0.52.0 - 0.52.1 and 0.53.0 - 0.62.4 GHSA-m65r-rprj-r5rg
0.34.0 and 0.36.0 - 0.36.2 and 0.37.1 and 0.38.0 and 0.39.0 - 0.40.2 and 0.42.0 and 0.43.0 and 0.44.0 - 0.45.0 and 0.46.0 and 0.48.0 - 0.49.2 and 0.50.0 - 0.50.4 and 0.51.0 - 0.51.1 and 0.52.0 - 0.52.1 and 0.53.0 - 0.62.4 GHSA-m65r-rprj-r5rg
View all vulnerabilities for these packages

Impacted packages

Timeline

Published
7 hours ago
September 30, 2026 at 11:26 PM UTC
Fixed (0.63.0)
1 month ago
August 21, 2026 at 01:25 PM UTC
Last Modified
7 hours ago
September 30, 2026 at 11:30 PM UTC