Skip to main content
CVE Vulnerability Database

CVE-2025-3987: Totolink N150rt Firmware RCE Vulnerability

CVE-2025-3987 is a critical remote code execution vulnerability in Totolink N150rt Firmware 3.4.0-B20190525 caused by command injection in the formWsc file. This article covers the technical details, affected versions, and mitigations.

Published:

CVE-2025-3987 Overview

CVE-2025-3987 is a command injection vulnerability in the TOTOLINK N150RT wireless router running firmware version 3.4.0-B20190525. The flaw resides in the /boafrm/formWsc endpoint, where the localPin parameter is passed to a system command without proper sanitization. Authenticated attackers can manipulate this argument to inject arbitrary operating system commands. The exploit has been publicly disclosed, raising the likelihood of opportunistic attacks against exposed devices. The vulnerability is tracked under [CWE-74] (Improper Neutralization of Special Elements in Output) and [CWE-77] (Command Injection).

Critical Impact

Remote attackers with low-privileged access can execute arbitrary commands on the router, potentially gaining full control of the device and pivoting into the local network.

Affected Products

  • TOTOLINK N150RT router (hardware version 2.0)
  • TOTOLINK N150RT firmware 3.4.0-B20190525
  • Deployments exposing the router web management interface to untrusted networks

Discovery Timeline

  • 2025-04-27 - CVE-2025-3987 published to NVD
  • 2025-05-07 - Last updated in NVD database

Technical Details for CVE-2025-3987

Vulnerability Analysis

The vulnerability affects the request handler for /boafrm/formWsc, a CGI endpoint in the BOA web server used by TOTOLINK firmware. This handler processes Wi-Fi Protected Setup (WPS) configuration requests, including the device PIN. The localPin HTTP parameter is incorporated into a shell command without escaping or input validation. An attacker can append shell metacharacters such as semicolons or backticks to break out of the intended command context. Successful exploitation yields command execution as the web server process, which typically runs as root on consumer router firmware.

Root Cause

The root cause is improper neutralization of special elements in localPin before it reaches a system call. The form handler concatenates user input directly into a command string passed to system() or an equivalent shell invocation. No allowlist, escaping, or argument separation prevents shell interpretation of injected payloads.

Attack Vector

The attack is network-reachable and requires only low privileges, meaning a valid session or default credentials are typically sufficient. The attacker sends a crafted HTTP POST request to /boafrm/formWsc with a malicious localPin value. The EPSS score of 11.917% places this issue in the 93rd percentile for exploitation probability. Public proof-of-concept material is available in the GitHub PoC Repository and VulDB CTI Report #306323.

No verified exploit code is included here. Refer to the linked references for technical reproduction details.

Detection Methods for CVE-2025-3987

Indicators of Compromise

  • HTTP POST requests to /boafrm/formWsc containing shell metacharacters such as ;, |, &, $(, or backticks in the localPin field
  • Unexpected outbound connections originating from the router management plane
  • New or modified files in writable router directories such as /tmp or /var
  • Unusual processes spawned by the boa web server, including sh, wget, tftp, or busybox invocations

Detection Strategies

  • Inspect web server and reverse proxy logs for requests targeting /boafrm/formWsc with non-numeric localPin values
  • Deploy network IDS signatures that flag command injection patterns in HTTP POST bodies destined for the router management interface
  • Correlate authentication events with subsequent formWsc requests to identify brute-force or session reuse followed by exploitation

Monitoring Recommendations

  • Capture HTTP traffic to router administrative endpoints and forward to a centralized logging platform for inspection
  • Monitor DNS queries and outbound connections from router IP addresses for indicators of command-and-control activity
  • Alert on configuration changes, firmware downgrades, and unexpected admin sessions on edge devices

How to Mitigate CVE-2025-3987

Immediate Actions Required

  • Restrict access to the router web management interface to trusted internal networks only and disable WAN-side administration
  • Change default administrative credentials and enforce strong, unique passwords on the device
  • Disable WPS functionality if not required for operational use, reducing exposure of the affected form handler
  • Place the device behind a network segment with egress filtering until a vendor patch is available

Patch Information

At the time of publication, no official vendor patch is referenced in the NVD entry. Consult the TOTOLINK Security Page for firmware updates and advisories. Organizations operating the N150RT should consider replacing end-of-support hardware with vendor-maintained models.

Workarounds

  • Block external access to the /boafrm/formWsc endpoint at an upstream firewall or router ACL
  • Disable remote management features such as HTTP/HTTPS administration on the WAN interface
  • Segment vulnerable routers onto an isolated VLAN with restricted lateral movement paths
  • Replace unsupported TOTOLINK N150RT devices with current, vendor-maintained equipment where feasible

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.