/

CVE-2026-106804

Severity:

HIGH RISK

(7.5)

Stack Buffer Overflow (CWE-121) in Kamailio ims_qos_npn

CVE-2026-106804

Awaiting Analysis

Vulnerability type

Category:

Stack-Based Buffer Overflow

CWE:

CWE-20, CWE-120, CWE-121

Impact:

Denial of Service

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Kamailio's ims_qos_npn module has a stack-based buffer overflow when it copies an attacker-controlled host value from a SIP Via header into a fixed-size buffer without checking its length. An unauthenticated remote attacker may trigger the flaw with a crafted SIP REGISTER request, corrupting stack memory and causing the affected instance to terminate.

Affected context

The issue is reported in Kamailio v6.1.3 and v6.1.4, in the ims_qos_npn module's w_rx_aar_register() function. It becomes a risk when a deployment processes SIP REGISTER requests through this function and the host value from the Via header is copied into the fixed-size stack buffer without length validation.

Exploit preconditions

  • Attack surface: SIP request handling by the affected Kamailio module
  • Required access: No authentication is required; the attacker needs network reachability to the SIP service
  • Trigger point: Processing a crafted REGISTER request containing a Via header
  • Why exploitation is possible: The attacker-controlled host value is copied into a 46-byte stack buffer without validating its length

Why this happens

The function copies input from a SIP header into a fixed-size stack buffer without first ensuring the value fits. This is an input-validation weakness (CWE-20) that leads to an out-of-bounds write (CWE-120), specifically a stack-based buffer overflow (CWE-121). The resulting stack corruption can terminate the process; the supplied description identifies denial of service as the impact.

Potential impact

  • The affected Kamailio process may terminate, disrupting SIP service
  • SIP registration handling may become unavailable until service is restored
  • Repeated triggering could cause continued service disruption

General mitigation guidance

Defensive patterns include validating the length and format of header-derived values before copying them, and using bounded operations or dynamically sized storage rather than fixed-size buffers for variable-length input. Treat SIP headers as untrusted, reject values that exceed defined limits, and ensure error handling does not leave the service in an unstable state. Run the service with only the privileges it needs and limit network exposure to trusted SIP peers where feasible.

How teams detect issues like this

  • Use static analysis to identify copies into fixed-size buffers where source lengths are not checked or destination bounds are not enforced.
  • Review SIP header parsing and handling paths for attacker-controlled values passed to stack buffers.
  • Monitor for crashes or restarts in Kamailio associated with malformed or unusually long SIP headers.
  • Apply input-size limits and protocol validation at relevant network boundaries, with logging for rejected requests.

Sources

SourceLink
gist.github.comgist.github.com/hackeryounow/f5af75502ea6df600428c46bb9bbf39e
github.comgithub.com/kamailio/kamailio/issues/4953

Frequently asked

questions

Yes. The described attack uses a crafted SIP REGISTER request and does not require authentication, provided the attacker can reach the SIP service.

Network access to the relevant SIP request-handling path is the key prerequisite; authentication is not required according to the vulnerability description.

Validate input length before copying, enforce destination bounds, and prefer storage patterns that safely accommodate variable-length values.

Treat protocol header values as untrusted, enforce input limits at parsing boundaries, and use static analysis and code review to find unchecked copies into fixed-size buffers.

Find out what's already
exploitable in your codebase.