CVE-2021-43301

9.8 CRITICAL

📋 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

Products:
  • pjproject
  • PJSIP
  • applications using PJSUA API
Versions: All versions before 2.12.1
Operating Systems: Linux, Windows, macOS, BSD
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using the vulnerable pjsua_playlist_create function with untrusted input is vulnerable.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: HIGH - SIP/VoIP services are often internet-facing, making them accessible to remote attackers.
🏢 Internal Only: MEDIUM - Internal VoIP systems could still be targeted via internal network access or phishing.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW - Simple buffer overflow with attacker-controlled input.

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

all

Implement 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

📤 Share & Export