CVE-2025-47779
Executive Summary
CVE-2025-47779 is a high-severity vulnerability in the Asterisk open-source PBX and its certified variant. The flaw resides in the handling of SIP MESSAGE requests (RFC 3428), where authentication alignment is improperly enforced. An authenticated attacker can spoof the identity of any user to send spam or phishing messages, bypassing expected sender verification. This enables social engineering attacks, as messages appear to originate from trusted entities. The vulnerability has a CVSS score of 7.7, indicating significant impact on integrity and trust within the communication system. Patches are available in the specified versions.
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.
No signup required
CVSS Breakdown & Threat Level
- CVSS Score: 7.7 (High)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (authenticated attacker)
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: None
- Integrity Impact: High (spoofed messages)
- Availability Impact: None
- Threat Level: High – Exploitation allows impersonation and phishing, undermining trust in the PBX system.
Deep Dive & Mechanics
The vulnerability exists in the SIP stack of Asterisk when processing MESSAGE requests. According to RFC 3428, MESSAGE requests carry instant messages and should be authenticated to verify the sender's identity. However, due to improper alignment of authentication checks, the system fails to correlate the authenticated user with the sender identity in the message header. An authenticated attacker can craft a MESSAGE request with a spoofed From header, and the server will deliver it to the recipient without verifying that the authenticated user matches the claimed sender. This allows the attacker to impersonate any user (e.g., an administrator or colleague) and send arbitrary text messages. The attack does not require any special privileges beyond a valid SIP account, making it accessible to any authenticated user.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// In SIP message handling, authentication is checked but not tied to sender identity
int handle_sip_message(sip_msg_t *msg) {
if (authenticate_user(msg->auth_header)) {
// No check that msg->from matches authenticated user
deliver_message(msg->from, msg->to, msg->body);
return 0;
}
return -1;
}
Patched Code (Conceptual):
int handle_sip_message(sip_msg_t *msg) {
char *auth_user = get_authenticated_user(msg->auth_header);
if (auth_user && strcmp(auth_user, msg->from) == 0) {
deliver_message(msg->from, msg->to, msg->body);
return 0;
}
// Log mismatch and reject
log_warn("SIP MESSAGE from %s does not match authenticated user %s", msg->from, auth_user);
return -1;
}
The patch ensures that the From header in the MESSAGE request must match the authenticated user's identity, preventing spoofing.
Exploitation & Lab Setup
Red Team (Attack Simulation)
- Prerequisites: Obtain valid SIP credentials (username/password) for an Asterisk server running a vulnerable version.
- Craft Malicious MESSAGE Request: Use a SIP tool like
sipsakor a custom script to send a MESSAGE request with a spoofedFromheader.# Example using sipsak sipsak -M -f "sip:admin@victim-pbx.com" -t "sip:target@victim-pbx.com" -b "Urgent: Reset your password now!" -u attacker -a password -s sip:victim-pbx.com - Execute: Send the request. The target user receives a message appearing to come from
admin, enabling phishing.
Blue Team (Defense & Detection)
- Monitor SIP Logs: Look for MESSAGE requests where the
Fromheader does not match the authenticated user. - Enable Authentication Alignment: Apply the patch immediately.
- Network Segmentation: Restrict SIP traffic to trusted IPs.
- User Awareness: Train users to verify unexpected messages through alternate channels.
Indicators of Compromise (IOCs)
- SIP Logs: Entries showing MESSAGE requests with mismatched
Fromand authenticated user fields. - Network Traffic: SIP MESSAGE packets (method=MESSAGE) with
Fromheader containing a different URI than the authenticated user. - User Reports: Complaints of suspicious or unsolicited instant messages appearing to come from internal users.
Detection Engineering
YARA Rule
rule CVE_2025_47779_SIP_Message_Spoofing {
meta:
description = "Detects SIP MESSAGE requests with potential From header spoofing"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-47779"
strings:
$sip_method = "MESSAGE"
$from_header = /From:.*sip:/ nocase
$auth_header = /Authorization:.*username="([^"]+)"/ nocase
condition:
$sip_method and $from_header and $auth_header and
// Check if From user != auth user (simplified - requires context)
for any i in (1..#auth_header) : (
// This is a placeholder; real detection needs SIP parser
true
)
}
Sigma Rule
title: CVE-2025-47779 - SIP MESSAGE Spoofing Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects SIP MESSAGE requests where the From header does not match the authenticated user.
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: asterisk
detection:
selection:
event: "SIP MESSAGE received"
condition: selection
falsepositives:
- Legitimate multi-identity scenarios (rare)
level: high
Suricata Rule
alert sip any any -> any any (msg:"CVE-2025-47779 - SIP MESSAGE From Header Spoofing"; sip.method:"MESSAGE"; content:"From"; nocase; pcre:"/From:\s*sip:([^@]+)@/"; pcre:"/Authorization:\s*.*username=\"([^\"]+)\"/"; flow:to_server; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Patch: Upgrade to Asterisk 18.26.2, 20.14.1, 21.9.1, 22.4.1 or certified-asterisk 18.9-cert14, 20.7-cert5.
- Workaround: If patching is delayed, disable SIP MESSAGE support temporarily via
disallow=messageinsip.conf. - Access Control: Restrict SIP account creation and enforce strong authentication.
- Monitoring: Implement detection rules (above) to identify exploitation attempts.
- User Training: Educate users about phishing risks via PBX messaging.
Valters IT