Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2025-13304

CVE-2025-13304: D-Link DIR-825M Buffer Overflow Flaw

CVE-2025-13304 is a buffer overflow vulnerability in D-Link DIR-825M firmware that allows remote attackers to exploit the formPingDiagnosticRun function. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2025-13304 Overview

CVE-2025-13304 is a buffer overflow vulnerability affecting multiple D-Link router models, including the DWR-M920, DWR-M921, DWR-M960, DWR-M961, and DIR-825M running firmware versions 1.01.07 and 1.1.47. The flaw resides in the /boafrm/formPingDiagnosticRun endpoint, where the host argument is processed without proper bounds checking. Attackers can exploit this issue remotely over the network to corrupt memory. Public exploit details have been released, increasing the likelihood of opportunistic attacks against exposed devices.

Critical Impact

Remote attackers can trigger memory corruption on affected D-Link routers by sending a crafted host parameter to the ping diagnostic endpoint, potentially compromising router confidentiality, integrity, and availability.

Affected Products

  • D-Link DWR-M920, DWR-M921, DWR-M960, DWR-M961 (firmware 1.01.07 and 1.1.47)
  • D-Link DIR-825M (firmware 1.01.07 and 1.1.47)
  • DWR-M960 hardware revision B1

Discovery Timeline

  • 2025-11-17 - CVE-2025-13304 published to NVD
  • 2025-12-08 - Last updated in NVD database

Technical Details for CVE-2025-13304

Vulnerability Analysis

The vulnerability is classified under [CWE-119] (Improper Restriction of Operations within the Bounds of a Memory Buffer). It exists in the web management interface handled by the boa HTTP server embedded in D-Link router firmware. Specifically, the /boafrm/formPingDiagnosticRun handler accepts a user-supplied host parameter intended for network ping diagnostics. The handler copies this value into a fixed-size stack or heap buffer without enforcing length limits, leading to a classic buffer overflow.

Successful exploitation can overwrite adjacent memory regions, including saved return addresses and function pointers. Depending on firmware build hardening, this can result in router crashes, denial of service, or arbitrary code execution within the context of the web server process. Public disclosure of exploit details lowers the barrier for attackers to develop working payloads.

Root Cause

The root cause is missing input length validation on the host parameter passed to the ping diagnostic routine. The firmware uses unsafe string handling on attacker-controlled input copied from HTTP POST data into a finite-size buffer.

Attack Vector

The attack is initiated over the network against the router's HTTP management interface. An authenticated low-privileged session is required, after which the attacker submits a POST request to /boafrm/formPingDiagnosticRun containing an oversized host field. Routers with management exposed to the WAN or to untrusted LAN segments are at the greatest risk.

// Vulnerable request pattern (illustrative)
// No verified PoC code is reproduced here. See referenced advisories for technical details.
POST /boafrm/formPingDiagnosticRun HTTP/1.1
Host: <router-ip>
Content-Type: application/x-www-form-urlencoded

host=<oversized payload>&...

Detection Methods for CVE-2025-13304

Indicators of Compromise

  • HTTP POST requests to /boafrm/formPingDiagnosticRun containing abnormally long host parameter values
  • Unexpected reboots or crashes of the boa web server on affected D-Link routers
  • Unusual outbound traffic from router management interfaces following web admin requests

Detection Strategies

  • Inspect router access logs for repeated requests to formPingDiagnosticRun from unfamiliar source IPs
  • Deploy network intrusion detection signatures that flag POST requests to /boafrm/formPingDiagnosticRun with host parameter values exceeding typical hostname length (253 bytes)
  • Monitor for repeated HTTP 5xx responses or connection resets from router management interfaces

Monitoring Recommendations

  • Forward router syslog data to a centralized log platform for anomaly review
  • Alert on any HTTP requests targeting /boafrm/ endpoints originating from WAN-side sources
  • Track firmware version inventory to identify devices running affected 1.01.07 or 1.1.47 builds

How to Mitigate CVE-2025-13304

Immediate Actions Required

  • Disable remote (WAN) administration on all affected D-Link routers until a vendor patch is applied
  • Restrict LAN-side access to the web management interface to a dedicated management VLAN or trusted host
  • Rotate administrative credentials on affected devices, since exploitation requires authenticated access
  • Review the D-Link Security Information page for forthcoming firmware updates

Patch Information

At the time of NVD publication, no fixed firmware version has been published for the affected DWR-M920, DWR-M921, DWR-M960, DWR-M961, or DIR-825M models. Operators should monitor the D-Link support portal and the VulDB entry for this issue for updates.

Workarounds

  • Block external access to TCP port 80/443 on the router WAN interface using upstream firewall rules
  • Place vulnerable routers behind a network segmentation boundary that restricts who can reach the management UI
  • Where feasible, replace end-of-support devices with currently supported models that receive security updates
bash
# Example upstream firewall rule to block WAN access to router HTTP management
iptables -I FORWARD -p tcp -d <router-wan-ip> --dport 80 -j DROP
iptables -I FORWARD -p tcp -d <router-wan-ip> --dport 443 -j DROP

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

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.