Summary
The epa4all Java client for ePA 3.0 contains an improper certificate validation flaw where ECDSA signatures are not actually verified in SignedPublicKeysTrustValidatorImpl.isTrusted().
As long as signatures are structurally valid, the method reports certificates as trusted, which can allow attackers to bypass authentication and present untrusted or forged certificates in Telematik Infrastruktur contexts.
Affected context
This vulnerability affects deployments using the epa4all-client Java library prior to version 1.2.1 where:
- SignedPublicKeysTrustValidatorImpl.isTrusted() is used to validate public key certificates
- ECDSA-based signatures are expected to protect trust decisions
- Certificate acceptance controls rely on the boolean result of this method for trust evaluation
The issue is most relevant in environments where external or network-provided certificates are consumed as part of Telematik Infrastruktur or related ePA 3.0 workflows.
Exploit preconditions
- Attack surface: Any component or service that uses epa4all-client's SignedPublicKeysTrustValidatorImpl.isTrusted() to decide whether to trust a certificate.
- Required access: Ability to present or inject certificates (e.g., acting as a client, peer service, or man-in-the-middle in a certificate-based authentication flow).
- Trigger point: Invoking isTrusted() on a certificate chain with an ECDSA signature that is structurally valid but does not match the expected signer.
- Why exploitation is possible: The implementation initializes the Signature object and calls Signature.verify(), but discards its boolean return value. As a result, any structurally well-formed signature is effectively treated as valid, and the method returns true regardless of whether the signature matches the certified data.
Why this happens
The underlying bug is a logic error in the certificate validation routine that maps to CWE-295: Improper Certificate Validation.
Specifically, SignedPublicKeysTrustValidatorImpl.isTrusted() performs several correct steps—building a certificate chain, performing OCSP checks, and configuring the ECDSA Signature instance—but fails to enforce the critical condition that Signature.verify() must succeed.
By ignoring the boolean outcome of the signature verification call, the code transforms a cryptographic check into a no-op with respect to trust decisions.
Abstractly, this reflects a pattern where security-critical API return values (such as the result of a signature verification) are computed but not validated, causing all inputs that conform to the expected structure to be accepted as authentic.
Potential impact
- Attackers may present forged certificates that are accepted as trusted even when not signed by a legitimate authority.
- Mutual TLS or certificate-based client authentication may be bypassed, enabling impersonation of legitimate services or users.
- Man-in-the-middle attackers could introduce their own certificates into secure channels, undermining confidentiality and integrity.
- Downstream authorization decisions that rely on the trust validator's output can be subverted, leading to unauthorized access to protected resources.
General mitigation guidance
Effective mitigation focuses on ensuring that certificate trust decisions strictly depend on verified cryptographic checks and well-defined trust anchors.
Common defensive patterns include:
- Enforcing that the result of signature verification (e.g., Signature.verify()) must be checked and cause immediate failure on false.
- Centralizing certificate validation logic in a small, well-reviewed module instead of duplicating it across the codebase.
- Applying strict verification policies that combine chain validation, revocation status, and signature checks, failing closed on any inconsistency.
- Minimizing reliance on custom cryptographic or trust-validation code and preferring vetted libraries and platform-provided TLS stacks.
- Designing APIs so that failure to validate certificates is explicit and cannot be silently ignored (for example, by throwing exceptions rather than returning booleans that can be discarded).
How teams detect issues like this
Organizations can detect similar issues through a combination of review and automated analysis:
- Static analysis rules targeting cryptographic APIs to flag ignored return values from methods like Signature.verify(), Certificate.verify(), or similar primitives.
- Code review checklists that explicitly require reviewers to trace the result of certificate, signature, and MAC verification through to the final decision.
- Security testing that introduces invalid signatures and observes whether services still treat certificates or messages as trusted.
- Policy enforcement in CI pipelines to block merges when security-critical functions are invoked without using their return values or when custom certificate validation logic bypasses standard trust managers.

