CVE-2026-13757 Overview
CVE-2026-13757 is a denial-of-service vulnerability in p11-kit, a library that provides a way to load and enumerate PKCS#11 modules on Linux systems. The flaw resides in the RPC message attribute parsing functions p11_rpc_message_get_attribute() and p11_rpc_message_get_attribute_array_value(), which form a mutually-recursive call chain without any recursion depth limit. An unauthenticated attacker with local access to the p11-kit RPC Unix domain socket can send a crafted request containing deeply nested template attributes. This triggers stack exhaustion, crashing the p11-kit server process and any dependent services relying on it for cryptographic operations.
Critical Impact
Local unauthenticated attackers can crash the p11-kit RPC server through unbounded recursion, disrupting PKCS#11-dependent cryptographic services.
Affected Products
- p11-kit (upstream library)
- Red Hat Enterprise Linux distributions bundling vulnerable p11-kit versions
- Linux systems exposing the p11-kit RPC Unix domain socket to local users
Discovery Timeline
- 2026-06-29 - CVE-2026-13757 published to NVD
- 2026-07-01 - Last updated in NVD database
Technical Details for CVE-2026-13757
Vulnerability Analysis
The flaw is classified as uncontrolled recursion [CWE-674]. The p11-kit RPC protocol serializes PKCS#11 attributes over a Unix domain socket. Certain attribute types — CKA_WRAP_TEMPLATE, CKA_UNWRAP_TEMPLATE, and CKA_DERIVE_TEMPLATE — encode nested attribute arrays. Parsing these attributes requires the server to descend into each nested template and re-invoke attribute parsing on its children.
The functions p11_rpc_message_get_attribute() and p11_rpc_message_get_attribute_array_value() call each other recursively to walk this structure. Neither function enforces a maximum nesting depth. An attacker who supplies attributes nested thousands of levels deep drives the server's call stack past its allocated size. The resulting stack overflow terminates the p11-kit process and any service depending on it for key management or cryptographic operations.
Root Cause
The root cause is missing input validation on the nesting depth of PKCS#11 template attributes during RPC message deserialization. The mutually-recursive parser trusts client-supplied structure depth, converting a bounded protocol feature into an unbounded stack consumer.
Attack Vector
Exploitation requires local access to the p11-kit RPC Unix domain socket. No authentication is required beyond the socket's filesystem permissions. The attacker constructs a serialized RPC request in which a CKA_WRAP_TEMPLATE, CKA_UNWRAP_TEMPLATE, or CKA_DERIVE_TEMPLATE attribute contains another such template, repeated to a depth sufficient to exhaust the server thread's stack. Sending this message crashes the daemon.
No verified public proof-of-concept code has been released. Refer to the Red Hat CVE-2026-13757 Advisory and Red Hat Bug Report #2494556 for technical details.
Detection Methods for CVE-2026-13757
Indicators of Compromise
- Unexpected termination or repeated restarts of the p11-kit-server or p11-kit process on affected hosts.
- Segmentation fault entries in system logs (journalctl, dmesg) referencing p11-kit with stack-related fault addresses.
- Application errors from PKCS#11 consumers reporting lost connections to the p11-kit RPC socket.
Detection Strategies
- Monitor process exit codes and core dumps for p11-kit services and correlate with SIGSEGV or stack overflow signatures.
- Audit access to the p11-kit RPC Unix domain socket path and flag connections from unexpected local UIDs.
- Track anomalous volumes of RPC messages or oversized serialized attribute payloads against baseline usage.
Monitoring Recommendations
- Enable core dump collection for p11-kit processes to preserve forensic evidence of exploitation attempts.
- Alert on repeated crashes of PKCS#11-dependent services such as GnuTLS or NSS-consuming applications.
- Review auditd rules covering the p11-kit socket path for connection tracking on multi-user systems.
How to Mitigate CVE-2026-13757
Immediate Actions Required
- Apply vendor-supplied updates for p11-kit as they become available through your Linux distribution's package manager.
- Restrict filesystem permissions on the p11-kit RPC Unix domain socket to trusted local users only.
- Identify services that depend on p11-kit and prepare restart procedures in case of daemon crashes.
Patch Information
Consult the Red Hat CVE-2026-13757 Advisory for current package status and errata. Upstream fixes introduce a recursion depth limit in p11_rpc_message_get_attribute() and p11_rpc_message_get_attribute_array_value() to reject excessively nested template attributes before stack exhaustion occurs.
Workarounds
- Disable the p11-kit RPC server on hosts that do not require remote PKCS#11 module sharing.
- Tighten socket permissions so only intended service accounts can connect to the p11-kit RPC endpoint.
- Run p11-kit under a resource-constrained systemd unit that automatically restarts on failure to reduce service disruption.
# Restrict p11-kit RPC socket access to a dedicated group
chown root:p11kit-users /run/user/$(id -u)/p11-kit/pkcs11
chmod 0660 /run/user/$(id -u)/p11-kit/pkcs11
# Enable automatic restart on crash via systemd override
systemctl edit p11-kit-server.service
# [Service]
# Restart=on-failure
# RestartSec=2s
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

