CVE-2021-43301
📋 TL;DR
This is a critical stack buffer overflow vulnerability in the PJSUA API of pjproject when calling pjsua_playlist_create. An attacker can exploit this by providing malicious file_names input, potentially leading to remote code execution. Systems using vulnerable versions of pjproject for SIP/VoIP applications are affected.
💻 Affected Systems
- pjproject
- PJSIP
- applications using PJSUA API
📦 What is this software?
Pjsip by Teluu
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution with full system compromise, allowing attacker to execute arbitrary code with application privileges.
Likely Case
Denial of service through application crash, with potential for remote code execution in targeted attacks.
If Mitigated
Application crash without code execution if exploit fails or protections like ASLR/stack canaries are effective.
🎯 Exploit Status
The vulnerability is straightforward to exploit given the lack of input validation.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 2.12.1 and later
Vendor Advisory: https://github.com/pjsip/pjproject/security/advisories/GHSA-qcvw-h34v-c7r9
Restart Required: Yes
Instructions:
1. Update pjproject to version 2.12.1 or later. 2. Recompile any applications using PJSUA. 3. Restart affected services.
🔧 Temporary Workarounds
Input validation wrapper
allImplement custom input validation for pjsua_playlist_create calls to limit file_names length.
// Code-level workaround: Validate file_names length before calling pjsua_playlist_create
🧯 If You Can't Patch
- Network segmentation: Isolate VoIP systems from untrusted networks.
- Input filtering: Implement application-level validation of all inputs to pjsua_playlist_create.
🔍 How to Verify
Check if Vulnerable:
Check pjproject version with 'pkg-config --modversion pjproject' or examine application dependencies.
Check Version:
pkg-config --modversion pjproject || grep 'PJ_VERSION' in source headers
Verify Fix Applied:
Confirm version is 2.12.1 or higher and verify the patch is applied in source code if compiled from source.
📡 Detection & Monitoring
Log Indicators:
- Application crashes with segmentation faults
- Unusual SIP/VoIP traffic patterns
Network Indicators:
- Malformed SIP packets targeting pjsua functions
- Unexpected connections to VoIP services
SIEM Query:
source="voip_logs" AND (event="crash" OR event="segfault")
🔗 References
- https://github.com/pjsip/pjproject/security/advisories/GHSA-qcvw-h34v-c7r9
- https://lists.debian.org/debian-lts-announce/2022/03/msg00035.html
- https://lists.debian.org/debian-lts-announce/2022/11/msg00021.html
- https://lists.debian.org/debian-lts-announce/2023/08/msg00038.html
- https://www.debian.org/security/2022/dsa-5285
- https://github.com/pjsip/pjproject/security/advisories/GHSA-qcvw-h34v-c7r9
- https://lists.debian.org/debian-lts-announce/2022/03/msg00035.html
- https://lists.debian.org/debian-lts-announce/2022/11/msg00021.html
- https://lists.debian.org/debian-lts-announce/2023/08/msg00038.html
- https://lists.debian.org/debian-lts-announce/2024/09/msg00030.html
- https://www.debian.org/security/2022/dsa-5285