CVE-2021-43299

9.8 CRITICAL

📋 TL;DR

CVE-2021-43299 is a critical stack-based buffer overflow vulnerability in the PJSUA API of the pjproject library, triggered when calling pjsua_player_create with a maliciously long filename argument. This allows remote attackers to execute arbitrary code or cause denial-of-service on systems using vulnerable versions of the library. It affects applications that utilize the PJSUA API for media playback, such as VoIP and multimedia software.

💻 Affected Systems

Products:
  • pjproject
  • applications using PJSUA API (e.g., VoIP software, media players)
Versions: Versions before 2.12.1
Operating Systems: Linux, Windows, macOS, other Unix-like systems
Default Config Vulnerable: ⚠️ Yes
Notes: Systems with applications that call pjsua_player_create with user-controlled filenames are vulnerable; default configurations may expose this if the API is used.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to full system compromise, enabling attackers to install malware, steal data, or pivot to other systems.

🟠

Likely Case

Denial-of-service crashes or potential remote code execution in exposed applications, depending on exploitability and mitigations like ASLR.

🟢

If Mitigated

Limited to denial-of-service if exploit fails or controls like input validation are implemented, reducing impact to service disruption.

🌐 Internet-Facing: HIGH, as the vulnerability can be exploited remotely via network-accessible applications using the vulnerable API without authentication.
🏢 Internal Only: MEDIUM, as internal systems may still be vulnerable if they run affected software, but exposure is reduced compared to internet-facing systems.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation is straightforward due to lack of input validation; public proof-of-concept code exists, increasing risk of weaponization in attacks.

🛠️ 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. For Debian systems, apply security updates via 'apt-get update && apt-get upgrade'. 3. Restart affected applications or services to apply the patch.

🔧 Temporary Workarounds

Input Validation for Filenames

all

Implement strict input validation to limit filename length and characters before passing to pjsua_player_create.

# Example: In application code, validate filename length (e.g., max 255 chars) and sanitize input.

Disable Vulnerable Functionality

all

If possible, disable or restrict usage of pjsua_player_create in applications until patched.

# Modify application configuration or code to avoid calling pjsua_player_create with untrusted inputs.

🧯 If You Can't Patch

  • Isolate affected systems in a segmented network to limit exposure and prevent lateral movement.
  • Implement strict firewall rules to block unnecessary network access to applications using the vulnerable API.

🔍 How to Verify

Check if Vulnerable:

Check the pjproject version; if below 2.12.1, it is vulnerable. Use 'pkg-config --modversion pjproject' or inspect library files.

Check Version:

pkg-config --modversion pjproject 2>/dev/null || grep -i version /usr/include/pjlib.h 2>/dev/null

Verify Fix Applied:

After updating, confirm version is 2.12.1 or higher using the same command and test that pjsua_player_create no longer overflows with long filenames.

📡 Detection & Monitoring

Log Indicators:

  • Application crashes or segmentation faults in logs related to pjsua_player_create calls
  • Unusual long filename inputs in application logs

Network Indicators:

  • Anomalous network traffic to services using PJSUA API, especially with large payloads

SIEM Query:

Example: 'source=*log* AND ("segmentation fault" OR "buffer overflow") AND "pjsua"'

🔗 References

📤 Share & Export