CVE-2020-29361
📋 TL;DR
CVE-2020-29361 is an integer overflow vulnerability in p11-kit library versions 0.21.1 through 0.23.21. Missing overflow checks before memory allocation functions allow attackers to cause heap-based buffer overflows, potentially leading to arbitrary code execution. Systems using p11-kit for PKCS#11 cryptographic operations are affected.
💻 Affected Systems
- p11-kit
📦 What is this software?
P11 Kit by P11 Kit Project
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution with the privileges of the process using p11-kit, potentially leading to full system compromise.
Likely Case
Denial of service through application crashes or memory corruption.
If Mitigated
Limited impact if proper memory protections (ASLR, DEP) are enabled and the process runs with minimal privileges.
🎯 Exploit Status
Exploitation requires triggering specific code paths in p11-kit with carefully crafted input. No public exploits have been documented.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 0.23.22 or later
Vendor Advisory: https://github.com/p11-glue/p11-kit/security/advisories/GHSA-q4r3-hm6m-mvc2
Restart Required: Yes
Instructions:
1. Update p11-kit package using your distribution's package manager. 2. For Debian/Ubuntu: sudo apt update && sudo apt upgrade p11-kit. 3. For RHEL/CentOS: sudo yum update p11-kit. 4. Restart affected services or reboot system.
🔧 Temporary Workarounds
Disable vulnerable functionality
linuxIf p11-kit features are not essential, disable PKCS#11 module loading in applications.
Configure applications to not use p11-kit modules via their configuration files
🧯 If You Can't Patch
- Implement strict network controls to limit access to services using p11-kit
- Run applications with minimal privileges and enable memory protection mechanisms (ASLR, DEP)
🔍 How to Verify
Check if Vulnerable:
Check p11-kit version: p11-kit --version
Check Version:
p11-kit --version
Verify Fix Applied:
Verify version is 0.23.22 or higher: p11-kit --version | grep -E '0\.23\.2[2-9]|0\.2[4-9]|1\.[0-9]'
📡 Detection & Monitoring
Log Indicators:
- Application crashes with segmentation faults in p11-kit related processes
- Memory corruption errors in system logs
Network Indicators:
- Unusual network connections from services using p11-kit
SIEM Query:
process.name:p11-kit AND (event.action:crash OR event.outcome:failure)
🔗 References
- https://github.com/p11-glue/p11-kit/releases
- https://github.com/p11-glue/p11-kit/security/advisories/GHSA-q4r3-hm6m-mvc2
- https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b%40%3Cissues.bookkeeper.apache.org%3E
- https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4%40%3Cissues.bookkeeper.apache.org%3E
- https://lists.debian.org/debian-lts-announce/2021/01/msg00002.html
- https://www.debian.org/security/2021/dsa-4822
- https://github.com/p11-glue/p11-kit/releases
- https://github.com/p11-glue/p11-kit/security/advisories/GHSA-q4r3-hm6m-mvc2
- https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b%40%3Cissues.bookkeeper.apache.org%3E
- https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4%40%3Cissues.bookkeeper.apache.org%3E
- https://lists.debian.org/debian-lts-announce/2021/01/msg00002.html
- https://www.debian.org/security/2021/dsa-4822