The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2023-22741

CVE-2023-22741: Signalwire Sofia-sip RCE Vulnerability

CVE-2023-22741 is a remote code execution vulnerability in Signalwire Sofia-sip caused by missing length checks in STUN packet handling, enabling heap overflow attacks. This article covers technical details, affected versions, and mitigation.

Published: February 4, 2026

CVE-2023-22741 Overview

CVE-2023-22741 is a critical heap-based buffer overflow vulnerability in Sofia-SIP, an open-source SIP User-Agent library compliant with the IETF RFC3261 specification. The vulnerability exists in the STUN packet parsing functionality, where the library lacks proper validation of both message length and attribute length fields. This oversight allows attackers to craft malicious STUN packets that trigger controllable heap overflow conditions, potentially leading to remote code execution.

The vulnerability has persisted in the codebase for 16 years, having been introduced in sofia-sip 1.12.4. When processing STUN packets, the stun_parse_attribute() function uses length values directly from attacker-controlled input without validating them against the remaining message buffer size, enabling heap corruption through carefully crafted network traffic.

Critical Impact

Network-accessible heap overflow vulnerability allowing remote code execution through malicious STUN packets without authentication or user interaction.

Affected Products

  • Signalwire Sofia-SIP (all versions prior to the security patch)

Discovery Timeline

  • 2023-01-19 - CVE CVE-2023-22741 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-22741

Vulnerability Analysis

The vulnerability resides in Sofia-SIP's STUN protocol implementation, specifically in the message parsing routines. When the library processes incoming STUN packets, it extracts attribute type and length values from the packet header and uses these values to control memory copy operations. The fundamental flaw is that the code trusts the length value specified in the packet without verifying that sufficient data remains in the message buffer.

In the vulnerable stun_parse_attribute() function, after extracting an attribute's type and length value from the packet, the length is used directly to copy data from the heap buffer. This occurs regardless of how much data actually remains in the message. Since an attacker can control the length value through crafted network packets, and the overflowed data is subsequently written to heap chunks, this creates conditions suitable for heap grooming attacks and other advanced exploitation techniques.

Root Cause

The root cause is insufficient input validation in the STUN packet parser. The code fails to implement two critical security checks:

  1. Message length validation: No verification that the overall STUN message length field doesn't exceed the actual buffer size
  2. Attribute length validation: No bounds checking to ensure individual attribute length values don't exceed the remaining unparsed portion of the message

This is classified under CWE-120 (Buffer Copy without Checking Size of Input) and CWE-787 (Out-of-bounds Write), representing a classic pattern of trusting attacker-supplied length values in network protocol parsing.

Attack Vector

The attack vector is network-based, requiring no authentication or user interaction. An attacker can exploit this vulnerability by:

  1. Sending a malformed STUN packet to a system running vulnerable Sofia-SIP
  2. Including attribute length values that exceed the actual message buffer
  3. Triggering heap overflow during packet parsing
  4. Using heap grooming techniques to achieve code execution

The security patch addresses this by adding proper bounds checking:

c
// Patch: Add message length validation in stun_common.c
// Source: https://github.com/freeswitch/sofia-sip/commit/da53e4fbcb138b080a75576dd49c1fff2ada2764

  /* parse header first */
  p = msg->enc_buf.data;

  if (get16(p, 2) > (msg->enc_buf.size - 20))
  {
    SU_DEBUG_3(("%s: Error STUN Message Length is too big.\n", __func__));
    return -1;
  }

  msg->stun_hdr.msg_type = get16(p, 0);
  msg->stun_hdr.msg_len = get16(p, 2);
  memcpy(msg->stun_hdr.tran_id, p + 4, STUN_TID_BYTES);

Additionally, the function signature was updated to pass remaining buffer length for proper validation:

c
// Patch: Update function signature in stun_common.h
// Source: https://github.com/freeswitch/sofia-sip/commit/da53e4fbcb138b080a75576dd49c1fff2ada2764

/* Common functions */
int stun_parse_message(stun_msg_t *msg);
-int stun_parse_attribute(stun_msg_t *msg, unsigned char *p);
+int stun_parse_attribute(stun_msg_t *msg, unsigned char *p, size_t left_len);
int stun_parse_attr_address(stun_attr_t *attr, const unsigned char *p, unsigned len);
int stun_parse_attr_error_code(stun_attr_t *attr, const unsigned char *p, unsigned len);
int stun_parse_attr_unknown_attributes(stun_attr_t *attr, const unsigned char *p, unsigned len);

Detection Methods for CVE-2023-22741

Indicators of Compromise

  • Malformed STUN packets with attribute length values exceeding message boundaries
  • Unexpected crashes or segmentation faults in processes using Sofia-SIP library
  • Anomalous memory patterns indicating heap corruption in SIP-related processes
  • Network traffic containing STUN messages with unusually large length fields

Detection Strategies

  • Deploy network intrusion detection rules to identify STUN packets with mismatched length fields
  • Monitor application logs for STUN parsing errors or memory-related exceptions
  • Implement deep packet inspection for SIP/STUN traffic to detect malformed protocol messages
  • Use memory sanitizers (ASAN) in development and testing environments to identify heap overflow attempts

Monitoring Recommendations

  • Configure SIEM alerts for repeated STUN parsing failures from single sources
  • Monitor memory usage patterns in SIP services for signs of heap manipulation
  • Enable verbose logging in Sofia-SIP to capture parsing errors and malformed packet details
  • Establish baselines for normal STUN traffic patterns to identify anomalous behavior

How to Mitigate CVE-2023-22741

Immediate Actions Required

  • Upgrade Sofia-SIP to the latest patched version immediately
  • If upgrade is not immediately possible, consider temporarily disabling STUN functionality if operationally feasible
  • Implement network-level filtering to block malformed STUN packets at perimeter firewalls
  • Audit systems for signs of exploitation and monitor for unusual process behavior

Patch Information

The vulnerability has been addressed in the official Sofia-SIP repository. The fix adds proper bounds checking for both the overall message length and individual attribute lengths during STUN packet parsing. Users should apply commit da53e4fbcb138b080a75576dd49c1fff2ada2764 or upgrade to a version containing this fix.

For additional details, refer to:

  • GitHub Security Advisory GHSA-8599-x7rq-fr54
  • GitHub Commit with Security Fix
  • Debian Security Advisory DSA-5410

Workarounds

  • There are no official workarounds for this vulnerability as stated in the advisory
  • Network segmentation can limit exposure of vulnerable SIP services to untrusted networks
  • Rate limiting STUN traffic may reduce exploitation opportunities but does not address the root cause
  • Consider deploying a web application firewall or deep packet inspection capable of validating STUN protocol conformance
bash
# Configuration example - Update Sofia-SIP via package manager (Debian/Ubuntu)
sudo apt update
sudo apt install --only-upgrade sofia-sip-bin libsofia-sip-ua0

# Verify installed version
dpkg -l | grep sofia-sip

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechSignalwire Sofia Sip

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability1.20%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-120

  • CWE-787
  • Technical References
  • Debian Security Advisory DSA-5410
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Security Advisory GHSA-8599
  • Latest CVEs
  • CVE-2025-70797: LimeSurvey XSS Vulnerability

  • CVE-2025-30650: Juniper Junos OS Auth Bypass Vulnerability

  • CVE-2026-35471: Goshs Path Traversal Vulnerability

  • CVE-2026-35393: Goshs Path Traversal Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English