CVE-2025-12204

5.3 MEDIUM

📋 TL;DR

A heap-based buffer overflow vulnerability exists in Kamailio's configuration file handler when processing malicious config files. This allows local attackers to potentially execute arbitrary code or crash the service. Only systems running vulnerable Kamailio versions with local access are affected.

💻 Affected Systems

Products:
  • Kamailio SIP Server
Versions: Version 5.5 specifically mentioned; other versions may be affected
Operating Systems: All platforms running Kamailio
Default Config Vulnerable: ⚠️ Yes
Notes: Requires ability to modify Kamailio configuration files locally; default permissions may restrict this.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Local privilege escalation leading to full system compromise via arbitrary code execution.

🟠

Likely Case

Service crash (denial of service) or limited information disclosure from heap memory.

🟢

If Mitigated

No impact if proper file permissions prevent unauthorized config file modifications.

🌐 Internet-Facing: LOW - Attack requires local access, not remotely exploitable.
🏢 Internal Only: MEDIUM - Local attackers with config file write access could exploit this.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploit details publicly disclosed but requires local access and config file manipulation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: UNKNOWN

Vendor Advisory: NONE

Restart Required: No

Instructions:

No official patch available; vendor did not respond to disclosure. Consider upgrading to latest Kamailio version and monitor for updates.

🔧 Temporary Workarounds

Restrict configuration file permissions

all

Set strict file permissions on Kamailio configuration files to prevent unauthorized modifications

chmod 600 /etc/kamailio/kamailio.cfg
chown root:root /etc/kamailio/kamailio.cfg

Use configuration file integrity monitoring

Linux

Monitor configuration files for unauthorized changes using tools like AIDE or Tripwire

# Install and configure AIDE: apt-get install aide
# Initialize database: aideinit
# Check for changes: aide --check

🧯 If You Can't Patch

  • Implement strict access controls to prevent unauthorized local users from modifying configuration files
  • Monitor system logs for configuration file modification attempts and Kamailio crash events

🔍 How to Verify

Check if Vulnerable:

Check Kamailio version: kamailio -V | grep 'version' and verify if running version 5.5 or other potentially affected versions

Check Version:

kamailio -V 2>&1 | grep -i version

Verify Fix Applied:

No official fix available; verify workarounds by checking configuration file permissions and monitoring for unauthorized changes

📡 Detection & Monitoring

Log Indicators:

  • Kamailio segmentation fault or crash logs
  • Unauthorized configuration file modification events in system logs
  • Unexpected Kamailio process termination

Network Indicators:

  • Sudden loss of SIP service availability
  • Unusual local file access patterns to Kamailio config files

SIEM Query:

source="kamailio.log" AND ("segmentation fault" OR "buffer overflow" OR "SIGSEGV") OR source="auth.log" AND "kamailio.cfg" AND ("modify" OR "change")

🔗 References

📤 Share & Export