Executive brief
The rfc3161-client library is used to verify digital timestamps, which prove that data existed at a specific time and was signed by a trusted authority. A security flaw allows an attacker to trick the library into accepting a forged timestamp by impersonating a trusted TimeStamping Authority (TSA). This could allow malicious actors to bypass security checks that rely on verifying the origin of a timestamp, potentially leading to the acceptance of fraudulent data or documents.
Technical details
An authorization bypass exists in rfc3161-client's signature verification logic within the `_verify_leaf_certs()` method. The library uses a naive algorithm to identify the leaf certificate in a PKCS#7 bag by selecting the first certificate that does not appear to issue any others in the same bag. An attacker can exploit this by taking a legitimate TimeStampResponse from a trusted TSA and appending two certificates: a spoofed "proxy" certificate matching the target's required Common Name and EKU, and a dummy certificate issued by the actual TSA leaf. This causes the library to perform authorization checks against the forged certificate while the underlying OpenSSL backend validates the cryptographic signature against the authentic TSA. The vulnerability is fixed in version 1.0.6.
Affected products
- trailofbits rfc3161-client < 1.0.6
Timeline
- 2026-04-08: disclosed
- 2026-04-08: advisory
- 2026-04-08: patched