Severity:

CRITICAL RISK

(9.1)

Improper Certificate Validation in ECDSA/ECC Signature

CVE-2026-5194

Analyzed

Vulnerability type

Category:

Improper Certificate Validation

CWE:

CWE-295

Impact:

Reduced Cryptographic Strength / Authentication Bypass

Severity:

CRITICAL RISK

(9.1)

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

Missing hash size and OID validation in ECDSA certificate verification allows digests that are smaller than required for the key type to be accepted as valid signatures.

When ECDSA/ECC verification is used in environments where EdDSA or ML-DSA is also enabled, this weakness can significantly reduce the effective security of certificate-based authentication, especially if the public CA key is known.

Affected context

The vulnerability appears in cryptographic libraries or components that:

  • Implement ECDSA/ECC certificate verification
  • Also enable EdDSA or ML-DSA algorithms in the same validation logic or code paths
  • Do not strictly enforce minimum hash/digest length and corresponding OID checks for a given ECDSA key size

It becomes relevant in deployments that rely on X.509-like certificate chains and trust public CA keys for transport security, signing, or client/server authentication.

Exploit preconditions

  • Attack surface: Any protocol or application that relies on ECDSA certificate verification (e.g., TLS-like handshakes, signed messages, or authentication tokens).
  • Required access: Ability to present or influence certificate chains or signed data (e.g., acting as a man-in-the-middle, malicious peer, or rogue service).
  • Trigger point: The moment the application verifies an ECDSA certificate or signature while EdDSA or ML-DSA support is enabled in the same cryptographic context.
  • Why exploitation is possible: The verification code does not enforce that:
  • The digest length matches the security level required by the ECDSA key, and
  • The associated hash OID and algorithm parameters are consistent with the key and signature.

This allows signatures computed over shorter digests to be accepted, undermining the intended security margin.

Why this happens

The root cause is incomplete validation logic in the certificate and signature verification process.

When ECDSA/ECC verification is implemented alongside EdDSA or ML-DSA, the code fails to:

  • Check that the hash or digest size used for the signature meets the minimum requirements for the key size, and
  • Validate that the Object Identifier (OID) and algorithm parameters correctly match the expected hashing and signing scheme.

This corresponds to CWE-295: Improper Certificate Validation, where the cryptographic validation procedure omits critical checks and therefore accepts weaker-than-intended signatures.

Conceptually, the bug treats all digests as equally acceptable for a key, instead of enforcing a binding between key strength, hash function, and signature parameters.

Potential impact

  • Attacker may reduce the effective security level of ECDSA-based authentication by exploiting smaller-than-intended digests.
  • In some scenarios, an attacker could craft signatures that are significantly easier to forge compared to correctly validated ECDSA signatures.
  • Man-in-the-middle actors could weaken or bypass certificate-based trust assumptions if they can leverage known CA public keys and influence signed data.
  • Long-term integrity and non-repudiation guarantees tied to ECDSA certificates could be undermined due to weakened signature validation.

General mitigation guidance

Mitigations focus on strengthening and constraining signature verification logic so it enforces the intended cryptographic security level:

  • Ensure that verification routines explicitly check that the hash/digest length is appropriate for the ECDSA key size and chosen curve.
  • Validate the OID and parameters for the hash and signature algorithms, rejecting combinations that are inconsistent, downgraded, or ambiguous.
  • Separate or clearly distinguish verification paths for different algorithms (ECDSA, EdDSA, ML-DSA) to avoid unintended parameter reuse or cross-algorithm assumptions.
  • Apply a strict policy that forbids use of truncated or undersized digests for certificate verification, even if they appear syntactically valid.
  • Favor secure-by-default configurations: disable non-essential signature schemes and restrict accepted algorithms and parameters through explicit policy rather than permissive defaults.

These patterns help ensure that signature verification always aligns with the intended security properties of the key material.

How teams detect issues like this

To identify this kind of issue, organizations can:

  • Use static analysis to search for cryptographic verification code that:
  • Accepts variable or unchecked digest lengths for ECDSA signatures
  • Fails to validate hash algorithm OIDs against key type and size
  • Shares verification logic between ECDSA, EdDSA, and ML-DSA without explicit parameter checks
  • Conduct focused code reviews on certificate and signature verification modules, with checklists that include:
  • Mapping from key size to allowed hash functions and digest lengths
  • Explicit OID/algorithm matching logic
  • Enforcement of algorithm and parameter policies (e.g., rejection of weak or truncated digests)
  • Integrate cryptographic compliance tests in CI/CD that:
  • Attempt verification using undersized digests
  • Attempt mixed or incorrect OID/hash combinations for given keys
  • Optionally employ automated security testing tools that support cryptographic protocol fuzzing to probe signature-handling edge cases, including digest truncation or cross-algorithm confusion.

Sources

SourceLink
github.comgithub.com/wolfSSL/wolfssl/pull/10131

Frequently asked

questions

It can be remotely exploitable in any system that performs ECDSA certificate or signature verification as part of a network protocol or remote authentication flow, especially when an attacker can present crafted certificates or signatures over the network.

The attacker typically needs the ability to act as a communicating peer, MitM, or untrusted signer capable of supplying or influencing certificates and signature inputs. They do not necessarily need local system access if the vulnerable verification is exposed via a network protocol.

The safest pattern is to enforce strict, explicit validation of hash/digest size and OIDs for every ECDSA verification:

  • Bind each key size to a limited set of allowed hash algorithms and digest lengths.
  • Reject signatures whose parameters do not match the configured policy.
  • Avoid shared verification code paths that blur distinctions between ECDSA, EdDSA, and ML-DSA.

Future prevention relies on:

  • Designing verification APIs that require explicit algorithm, key, and digest policies, rather than inferring or accepting flexible parameters.
  • Incorporating cryptographic code review by specialists and using checklists focused on parameter validation and downgrade resistance.
  • Adding regression tests that intentionally attempt to validate undersized digests or mismatched OID/hash combinations, ensuring they are consistently rejected.
Find out what's already
exploitable in your codebase.