/

CVE-2025-62514

Severity:

HIGH RISK

(8.3)

Cryptographic Validation Weakness in Parsec

CVE-2025-62514

Analyzed

Vulnerability type

Category:

Cryptographic Validation Weakness

CWE:

CWE-327, CWE-1240

Impact:

Confidentiality and Integrity Compromise via Undetected Man-in-the-Middle

Severity:

HIGH RISK

(8.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Parsec's libparsec_crypto component on the 3.x branch prior to 3.6.0 fails to reject weak-order Curve25519 points when built with the RustCrypto backend.

In Parsec Web deployments, a man-in-the-middle attacker can inject weak points into the Diffie–Hellman key exchange so that both parties derive the same shared key as the attacker, enabling a fraudulent but successful SAS code verification and undetected session interception.

Affected context

This vulnerability appears in Parsec environments where:

  • The 3.x branch of Parsec prior to 3.6.0 is used, and
  • libparsec_crypto is compiled with the RustCrypto backend (not libsodium), and
  • Curve25519 is used for Diffie–Hellman key exchange and SAS (Short Authentication String) verification.

It primarily impacts Parsec Web, where ephemeral key exchanges are performed over networks potentially exposed to active man-in-the-middle attackers. Desktop clients using the libsodium backend are not affected by this specific flaw.

Exploit preconditions

  • Attack surface: Network path between Parsec Web clients participating in a cryptographic key exchange.
  • Required access: Ability to perform an active man-in-the-middle attack (e.g., on-path control, compromised router, malicious Wi‑Fi AP).
  • Trigger point: The Diffie–Hellman key exchange on Curve25519 when the Parsec Web client uses libparsec_crypto with the RustCrypto backend.
  • Why exploitation is possible:
  • The implementation does not verify that peer public keys lie in the correct prime-order subgroup on Curve25519.
  • An attacker can supply specially crafted weak-order points to both parties.
  • Due to missing subgroup/point validation (CWE-1240), both sides may derive a shared key that is predictable and also known to the attacker, yet still produce matching SAS codes.

Why this happens

The core issue stems from insufficient validation of elliptic-curve public keys during Diffie–Hellman exchanges.

In secure Curve25519 implementations, received public points must be checked to ensure they belong to the correct prime-order subgroup and are not low- or mixed-order points. When built with the RustCrypto backend, libparsec_crypto omitted these checks, accepting weak-order points as valid inputs.

This maps to CWE-327: Use of a Broken or Risky Cryptographic Algorithm and CWE-1240: Use of a Cryptographic Primitive with a Risky Implementation, because the algorithm is used without enforcing the required group invariants, undermining the security guarantees of the key exchange and SAS verification.

Potential impact

  • An on-path attacker could successfully perform an undetected man-in-the-middle attack.
  • Both parties may derive a shared key that is also known to the attacker.
  • SAS (Short Authentication String) verification may incorrectly signal a secure, MITM-free channel.
  • Confidentiality of exchanged data can be compromised, as traffic may be decrypted in real time.
  • Integrity of communications can be subverted, with the attacker altering messages while remaining invisible to users.

General mitigation guidance

Effective mitigation focuses on enforcing robust elliptic-curve validation and hardening the cryptographic implementation:

  • Ensure all Curve25519 public keys are validated, including checks for low-order points, small subgroup elements, and other invalid points before use in key agreement.
  • Prefer well-reviewed, constant-time cryptographic backends that provide built-in subgroup and point validation for Curve25519.
  • Treat cryptographic backends as part of the trusted computing base and subject them to independent review, with explicit checks for known class issues such as weak public key validation.
  • Implement defense-in-depth at the protocol layer by designing SAS and authentication flows that assume key agreement failures are possible and explicitly handle suspicious or repeated verification scenarios.
  • Apply least-privilege and separation of concerns so that compromise of a single cryptographic operation does not automatically expose broader secrets or long-term keys.

How teams detect issues like this

Detection efforts can target both code and runtime behavior:

  • Static analysis and review:
  • Search for Curve25519/RustCrypto Diffie–Hellman usage lacking explicit point or subgroup validation checks.
  • Review cryptographic wrappers and abstractions to confirm they validate public keys before invoking low-level primitives.
  • Use security-focused linters or custom rules that flag elliptic-curve operations where inputs come directly from the network without validation.
  • Code review signals:
  • Key agreement code that assumes all received public keys are valid without checks.
  • Custom or hand-rolled cryptographic glue code around third-party libraries.
  • Policy and CI/CD:
  • Enforce policies requiring third-party crypto libraries to meet specific validation guarantees.
  • Integrate automated dependency and configuration checks to ensure safe backends are used consistently in production builds.
  • Runtime and testing:
  • Include negative test cases where weak-order or malformed points are injected to verify that the implementation rejects them.
  • Perform protocol-level penetration tests simulating MITM scenarios to confirm that SAS and key verification logic behaves correctly.

Sources

SourceLink
github.comgithub.com/Scille/parsec-cloud/blob/e7c5cdbc4234f606ccf3ab2be7e9edc22db16feb/libparsec/crates/crypto/src/rustcrypto/private.rs#L136-L138
github.comgithub.com/Scille/parsec-cloud/commit/197bb6387b49fec872b5e4a04dcdb82b3d2995b2
github.comgithub.com/Scille/parsec-cloud/security/advisories/GHSA-hrc9-gm58-pgj9
github.comgithub.com/dalek-cryptography/curve25519-dalek/blob/8c53a8f10b146a2fd65069437e3576e49b390e7a/curve25519-dalek/src/montgomery.rs#L132-L146
github.comgithub.com/dalek-cryptography/curve25519-dalek/blob/8c53a8f10b146a2fd65069437e3576e49b390e7a/x25519-dalek/src/x25519.rs#L364-L366

Frequently asked

questions

Yes. An attacker who can position themselves as a man-in-the-middle on the network path between Parsec Web clients can remotely exploit the weakness during the Diffie–Hellman key exchange.

The attacker needs active on-path capabilities, such as control over a network gateway, router, or Wi‑Fi access point. Passive eavesdropping alone is insufficient; the attacker must be able to intercept and modify key exchange messages.

The safest pattern is to ensure strict validation of all elliptic-curve public keys before use, rely on well-audited cryptographic libraries that enforce subgroup and point checks by default, and avoid custom cryptographic glue code that bypasses built-in safeguards.

Future implementations should adopt a "use, don't implement" approach: rely on mature, vetted cryptographic primitives; require formal validation of public keys for all key exchanges; include negative tests with malformed and weak-order points; and mandate security reviews for protocol and cryptographic code paths as part of the development lifecycle.

Find out what's already
exploitable in your codebase.