☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 4.8 🐛 CWE-119
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2025-12204

CVE-2025-12204 Heap Buffer Overflow in Kamailio
📅 PUBLISHED: 2025-10-27 02:02 UTC 🔄 UPDATED: 2026-09-23 10:16 UTC
[ ZERO-DAY / UNPATCHED ] [ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.27%
👁️
0.27% probability
6.8× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1203
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
VULNERABLE: UNKNOWN / CHECK VENDOR
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
4.8
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-12204 is a heap-based buffer overflow vulnerability in Kamailio 5.5, specifically within the rve_destroy function in src/core/rvalue.c. The vulnerability is triggered by manipulating configuration files, which requires local access. The CVSS score is 5.3 (Medium), with a low EPSS score of 0.0%, indicating a low probability of exploitation in the wild. The vendor has not responded to disclosure, and no official patch is available. The attack vector is local, and the exploit has been publicly disclosed.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

Kamailio is an open-source SIP server widely used in VoIP infrastructure. This vulnerability is not related to NPM, PyPI, Go, or Ruby packages. However, as a critical component in communication systems, a heap overflow could lead to denial of service or potential code execution, impacting service availability.

CVSS Breakdown & Threat Level

  • CVSS Score: 5.3 (Medium)
  • Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Attack Vector: Local (AV:L) – requires local access to the system.
  • Attack Complexity: Low (AC:L) – no special conditions needed.
  • Privileges Required: None (PR:N) – no authentication needed.
  • User Interaction: None (UI:N) – no user action required.
  • Scope: Unchanged (S:U) – vulnerability does not affect other components.
  • Confidentiality Impact: None (C:N) – no data exposure.
  • Integrity Impact: None (I:N) – no data modification.
  • Availability Impact: High (A:H) – could cause denial of service.

Threat Level: Medium. The local attack vector and requirement for config file manipulation reduce the risk, but the public exploit and lack of patch increase urgency for environments with untrusted local users.

Deep Dive & Mechanics

The vulnerability resides in the rve_destroy function within src/core/rvalue.c. This function is part of the configuration file handler, which parses and processes Kamailio configuration files. A heap-based buffer overflow occurs when the function improperly handles memory allocation or deallocation during the destruction of an rvalue structure.

Root Cause: The rve_destroy function does not properly validate the size of data being written to a heap buffer, leading to an overflow. This can be triggered by crafting a malicious configuration file that causes the function to write beyond the allocated buffer.

Attack Scenario: An attacker with local access to the Kamailio server can create a specially crafted configuration file. When Kamailio loads this file (e.g., during startup or reload), the overflow occurs, potentially corrupting heap metadata or overwriting adjacent memory. This could lead to a crash (denial of service) or, in more advanced scenarios, arbitrary code execution.

Impact: The primary impact is denial of service due to process crash. Code execution is theoretically possible but requires precise heap manipulation, which is complex.

Vulnerable vs. Patched Code

Vulnerable Code (Kamailio 5.5): The rve_destroy function in src/core/rvalue.c does not check the size of the data being freed or written, leading to a heap overflow.

// Vulnerable snippet (conceptual)
void rve_destroy(struct rvalue *rv) {
    // No size validation
    free(rv->data); // Potential double free or overflow
}

Patched Code (Hypothetical): A patch would add size checks and proper memory management.

// Patched snippet (conceptual)
void rve_destroy(struct rvalue *rv) {
    if (rv->data && rv->size > 0) {
        memset(rv->data, 0, rv->size); // Clear before free
        free(rv->data);
    }
}

Note: No official patch is available. The above is a hypothetical fix.

Exploitation & Lab Setup

Red Team

Exploit Usage: The exploit is publicly disclosed but no specific code is provided. The attack requires local access and the ability to modify Kamailio configuration files.

Lab Setup:

  1. Install Kamailio 5.5 on a Linux VM.
  2. Create a malicious configuration file (e.g., kamailio.cfg) with crafted rvalue structures.
  3. Start Kamailio with the malicious config: kamailio -f malicious.cfg.
  4. Monitor for crashes or heap corruption.

Proof of Concept (Conceptual):

# Create a malicious config file
echo "modparam(\"tm\", \"fr_timer\", 1000)" > /tmp/exploit.cfg
# Trigger the vulnerability by loading the config
kamailio -f /tmp/exploit.cfg

Blue Team

Detection:

  • Monitor for Kamailio crashes or abnormal terminations.
  • Use heap analysis tools (e.g., Valgrind) to detect memory corruption.
  • Enable core dumps and analyze them for signs of heap overflow.

Mitigation:

  • Restrict local access to the Kamailio server.
  • Use file integrity monitoring (FIM) to detect unauthorized changes to config files.
  • Apply the principle of least privilege to the Kamailio process.

Indicators of Compromise (IOCs)

  • File Hashes: (None provided)
  • Network Signatures: (None provided)
  • Process Anomalies: Kamailio process crashes with SIGSEGV or SIGABRT.
  • Log Entries: Kamailio logs showing "memory corruption" or "heap overflow" errors.
  • System Artifacts: Core dump files in /var/crash/ or /tmp/.

Detection Engineering

YARA Rule

rule CVE_2025_12204_Kamailio_HeapOverflow {
    meta:
        description = "Detects heap overflow in Kamailio rve_destroy function"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2025-12204"
    strings:
        $s1 = "rve_destroy" ascii wide nocase
        $s2 = "rvalue.c" ascii wide nocase
        $s3 = "heap" ascii wide nocase
    condition:
        all of them
}

Sigma Rule

title: Kamailio Heap Overflow Detection
id: 8f4b3c2a-1e5d-4f7b-9a0c-3d6e8f2b1a4c
status: experimental
description: Detects potential heap overflow in Kamailio via config file manipulation
author: Valters IT
logsource:
    product: linux
    service: syslog
detection:
    selection:
        - "kamailio" and "heap overflow"
        - "kamailio" and "SIGSEGV"
        - "kamailio" and "core dumped"
    condition: selection
falsepositives:
    - Legitimate crashes due to other bugs
level: high

Suricata Rule

alert tcp any any -> any 5060 (msg:"CVE-2025-12204 Kamailio Heap Overflow Attempt"; flow:to_server; content:"|00 00 00 00|"; depth:4; offset:0; classtype:attempted-dos; sid:1000001; rev:1;)

Note: The Suricata rule is a placeholder; actual exploitation is local and may not generate network traffic.

Remediation & Mitigation

Immediate Actions:

  1. Restrict Local Access: Limit who can log into the Kamailio server.
  2. File Integrity Monitoring: Use tools like AIDE or Tripwire to monitor config file changes.
  3. Apply Patches: Monitor Kamailio's official channels for a patch. If none, consider applying the hypothetical fix manually.
  4. Use AppArmor/SELinux: Confine the Kamailio process to reduce impact.

Long-Term:

  • Upgrade to a newer version of Kamailio if available.
  • Implement code review for memory management in custom configurations.
  • Use static analysis tools to detect similar vulnerabilities.

Workaround:

  • Avoid using untrusted configuration files.
  • Run Kamailio in a container with read-only filesystem for config files.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-12204/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.