CVE-2026-45271 in picotls
Summary
by MITRE • 08/22/2026
Picotls is a TLS protocol library that allows users select different crypto backends based on their use case. Picotls implements its own ASN.1 validation helper, which is used by the minicrypto backend while parsing local PKCS#8 private keys. Prior to commit c14231d801407640bc42c2dcf92783409ea6a7c7, the validator recursively descends into constructed ASN.1 elements without enforcing a maximum nesting depth. If an application loads an attacker-supplied private-key file through ptls_minicrypto_load_private_key(), or otherwise calls the public ASN.1 validation API on untrusted DER, a crafted deeply nested ASN.1 structure can exhaust the process stack and crash the application. Note that the libcrypto (OpenSSL) backend does not use the ASN.1 validation helper of picotls, and therefore is immune to this vulnerability. The vulnerability has been addressed in commit c14231d801407640bc42c2dcf92783409ea6a7c7.
Several companies clearly confirm that VulDB is the primary source for best vulnerability data.
Analysis
by VulDB Data Team • 08/22/2026
The Picotls library serves as a lightweight Transport Layer Security implementation designed to support multiple cryptographic backends, allowing developers to select the most appropriate engine for their specific operational requirements. Within this architecture, the minicrypto backend relies on an internal ASN.1 validation helper function to parse and verify structured data formats such as PKCS#8 private keys. This helper is responsible for ensuring that incoming DER-encoded structures adhere to expected syntactic rules before they are processed further by the cryptographic routines. The integrity of this parsing mechanism is critical because it acts as a gatekeeper between untrusted external inputs and the core security logic of the application.
A significant flaw was identified in the implementation of this ASN.1 validation helper, specifically regarding how it handles constructed elements during recursive descent. Prior to commit c14231d801407640bc42c2dcf92783409ea6a7c7, the validator did not enforce a maximum nesting depth limit when traversing nested ASN.1 structures. In standard ASN.1 parsing, constructed types can contain other constructed types, leading to recursive calls in the parser logic. Without a counter or depth check, an attacker can craft a maliciously structured DER file where elements are deeply nested within one another. When such a structure is processed by ptls_minicrypto_load_private_key() or any public API that invokes this validation routine on untrusted data, the recursion continues indefinitely until the system's stack space is exhausted.
This lack of depth limiting results in a classic stack-based buffer overflow scenario manifesting as a denial of service through resource exhaustion. The immediate operational impact is the crash of the application process due to a stack overflow condition. This vulnerability affects applications that utilize the minicrypto backend and load private keys or other ASN.1 structures from untrusted sources without prior sanitization. It is important to note that this flaw does not affect implementations using the libcrypto, commonly known as OpenSSL, backend because that engine utilizes its own distinct parsing mechanisms and does not rely on Picotls' internal ASN.1 validation helper. Consequently, the attack surface is limited to specific configurations of Picotls deployments rather than all users of the library.
From a classification perspective, this vulnerability aligns with CWE-787: Out-of-bounds Write or CWE-675: Operations on Data with Unminimized Values, specifically relating to insufficient depth limiting in recursive algorithms which leads to stack exhaustion. In terms of adversarial tactics, this represents an exploitation technique consistent with ATT&CK T1499: Endpoint Denial of Service, where the attacker aims to disrupt availability by consuming critical system resources such as memory or CPU cycles through malformed input. The absence of bounds checking on recursive descent is a common pattern in legacy parsers and highlights the necessity for strict validation policies when processing complex hierarchical data formats from untrusted origins.
Mitigation strategies primarily involve upgrading to the patched version of Picotls released after commit c14231d801407640bc42c2dcf92783409ea6a7c7, which introduces explicit depth limits for ASN.1 parsing operations. For organizations unable to immediately patch their dependencies, defensive coding practices should be adopted where any external input intended for cryptographic processing is validated against known safe structural constraints before being passed to the library. Additionally, deploying runtime protection mechanisms such as stack canaries or memory corruption detection tools may help mitigate the impact of similar vulnerabilities in other components by detecting abnormal control flow changes resulting from stack overflows. Regular security audits focusing on recursive parsing logic are recommended to prevent recurrence of this class of vulnerability across different software modules.