CVE-2023-27599
📋 TL;DR
CVE-2023-27599 is a denial-of-service vulnerability in OpenSIPS SIP server where a malformed To header in a SIP message triggers an abort() call, causing the server to crash. This affects OpenSIPS installations using functions like append_hf that process SIP headers. Attackers can exploit this to disrupt SIP services.
💻 Affected Systems
- OpenSIPS
📦 What is this software?
Opensips by Opensips
Opensips by Opensips
⚠️ Risk & Real-World Impact
Worst Case
Complete service outage of OpenSIPS server, disrupting all SIP-based communications including VoIP calls and messaging services.
Likely Case
Service disruption causing dropped calls and failed SIP transactions until service is restarted.
If Mitigated
Minimal impact with proper network segmentation and monitoring allowing quick detection and recovery.
🎯 Exploit Status
Exploitation requires sending a specially crafted SIP message with a malformed To header. No authentication is needed if the server is reachable.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.1.7 or 3.2.4
Vendor Advisory: https://github.com/OpenSIPS/opensips/security/advisories/GHSA-qvj2-vqrg-f5jx
Restart Required: Yes
Instructions:
1. Backup current configuration. 2. Stop OpenSIPS service. 3. Upgrade to OpenSIPS 3.1.7 or 3.2.4 using package manager or source compilation. 4. Verify configuration compatibility. 5. Restart OpenSIPS service.
🔧 Temporary Workarounds
Network Filtering
linuxImplement network-level filtering to block malformed SIP packets before they reach OpenSIPS.
iptables -A INPUT -p udp --dport 5060 -m string --algo bm --hex-string '|546f3a|' -j DROP
iptables -A INPUT -p tcp --dport 5060 -m string --algo bm --hex-string '|546f3a|' -j DROP
🧯 If You Can't Patch
- Implement strict network segmentation to limit access to OpenSIPS servers only to trusted SIP endpoints.
- Deploy intrusion detection systems to monitor for malformed SIP packets and alert on potential exploitation attempts.
🔍 How to Verify
Check if Vulnerable:
Check OpenSIPS version: opensips -V. If version is below 3.1.7 (for 3.1.x branch) or below 3.2.4 (for 3.2.x branch), the system is vulnerable.
Check Version:
opensips -V
Verify Fix Applied:
After patching, verify version is 3.1.7 or higher (3.1.x) or 3.2.4 or higher (3.2.x) and test with SIP traffic containing various To header formats.
📡 Detection & Monitoring
Log Indicators:
- OpenSIPS process crashes or restarts
- Abnormal termination messages in system logs
- Increased error logs related to SIP header parsing
Network Indicators:
- Unusual SIP packets with malformed To headers
- SIP traffic patterns causing service disruption
SIEM Query:
source="opensips.log" AND ("abort" OR "crash" OR "segmentation fault")
🔗 References
- https://github.com/OpenSIPS/opensips/commit/cb56694d290530ac308f44b453c18120b1c1109d
- https://github.com/OpenSIPS/opensips/security/advisories/GHSA-qvj2-vqrg-f5jx
- https://opensips.org/pub/audit-2022/opensips-audit-technical-report-full.pdf
- https://github.com/OpenSIPS/opensips/commit/cb56694d290530ac308f44b453c18120b1c1109d
- https://github.com/OpenSIPS/opensips/security/advisories/GHSA-qvj2-vqrg-f5jx
- https://opensips.org/pub/audit-2022/opensips-audit-technical-report-full.pdf