Buffer overflow in MikroTik RouterOS JSON parser reachable through the REST API

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2025-10948?

CVE-2025-10948 is a vulnerability classified as Buffer Copy without Checking Size of Input and Improper Restriction of Operations within the Bounds of a Memory Buffer, affecting RouterOS (affected versions: 7). This vulnerability is rated High, with a CVSS score of 8.7. Public exploit code or evidence is available for this vulnerability, but that does not confirm exploitation in the wild.

Overview

Original source data

A vulnerability has been found in MikroTik RouterOS 7. This affects the function parse_json_element of the file /rest/ip/address/print of the component libjson.so. The manipulation leads to buffer overflow. The attack is possible to be carried out remotely. The exploit has been disclosed to the public and may be used. Upgrading to version 7.20.1 and 7.21beta2 mitigates this issue. You should upgrade the affected component. The vendor replied: "Our bug tracker reports that your issue has been fixed. This means that we plan to release a RouterOS update with this fix. Make sure to upgrade to the next release when it comes out."

Affected products and scope

MikroTik RouterOS in the 7 release line, specifically the libjson.so JSON parsing component as used by the REST API endpoint /rest/ip/address/print. Fixed builds exist in the 7.20.1 and 7.21beta2 releases according to the record, and the vendor states its bug tracker records the issue as fixed with a RouterOS update planned. Earlier major release lines are not described as affected. Whether a given deployment is exposed depends on whether the REST API is reachable from untrusted networks and whether an attacker can authenticate to it; the record does not enumerate specific configurations that are exempt.

Technical details

The weakness is a buffer overflow (CWE-120) leading to memory corruption (CWE-119). The affected function is parse_json_element inside libjson.so, the shared library RouterOS uses for JSON parsing, and it is exercised through the /rest/ip/address/print REST endpoint. Supplying manipulated input causes the parser to write beyond the bounds of a buffer. The record does not describe the shape of the input required, the size or type of the buffer, or whether the overflow is on the stack or the heap; public detail on the internals is limited to the existence of a proof of concept. Exploitation is possible remotely, which for RouterOS means over the network through the REST interface rather than through local console access.

Exploitability

The attack vector is network based. An attacker needs a low-privileged authenticated session on the device and does not need to trick a user into any action. A public exploit exists: the record lists a public proof-of-concept repository, and states that the exploit has been disclosed and may be used. The record does not report known exploitation in the wild or any ransomware association. In practice the reachable population is RouterOS devices whose REST API is exposed beyond a trusted management network and where an attacker can obtain credentials, so internet-facing management planes carry the most risk.

Technical impact

A successful attack corrupts memory in the process handling REST requests. That gives an attacker the primitives that usually follow from a buffer overflow: potentially crashing the service or the device, and potentially redirecting execution to attacker-controlled code with the privileges of the REST service. The scoring in the record assumes high impact on confidentiality, integrity and availability, which is consistent with code execution on a network device. The limits are important: the record does not document a full exploitation chain, does not state which privileges the corrupted process runs with, and does not describe post-exploitation behaviour. A crash and a reboot of the device is the outcome defenders are most likely to observe if an attempt fails.

Business impact

RouterOS runs on routers, switches and firewalls, frequently at the edge of a network where the device sees and forwards production traffic. Memory corruption in a service that answers REST requests puts the device itself at risk: an attacker who gets a foothold could read and change router configuration, alter routing or firewall behaviour, and cause outages by crashing the service or the device. Because these devices often terminate VPNs and segment networks, control of one can expose what sits behind it. The barrier is authentication, so the realistic threat is an insider, a leaked or shared low-privilege account, or an internet-facing management interface with weak credentials. Network and infrastructure teams, and anyone with regulatory obligations around network availability and data in transit, should care. The record does not describe any breach or campaign, and no in-the-wild exploitation is reported.

Remediation

Upgrade RouterOS to a release that contains the fix. The vendor has told the reporter the issue is fixed in its tracker and that a RouterOS update will carry the fix, and the record names the 7.20.1 and 7.21beta2 releases as the versions where the problem is mitigated; apply the current fixed release rather than waiting. Until the device is upgraded, reduce exposure: keep the REST API and the management interface off untrusted networks, put them behind a management VLAN or an access-controlled jump path, and remove or disable accounts that do not need API access. Review who holds credentials to the device, since the flaw needs only low privileges to attempt. Where an upgrade cannot be scheduled quickly, treat the device as an untrusted host on the network and tighten what it is permitted to reach.

Detection

Look at what reaches the REST interface. Web or reverse-proxy logs in front of the device, and RouterOS logging for the REST service where it is enabled, can show requests to /rest/ip/address/print with unusually large, malformed or unexpected JSON bodies, or a burst of such requests from one source. On the device side, look for unexpected restarts of services, device reboots, crash or watchdog entries, and authentication events for API accounts, especially logins from addresses that never normally use the API. Compare the set of accounts with API access against what is actually needed, and check whether the management plane is reachable from outside the management network. Any of these is a reason to inspect the device's configuration and logs more closely rather than proof of compromise on its own.

Sources (10)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.