Exploitation of CVE-2018-14847 in MikroTik RouterOS
An unauthenticated remote file read vulnerability in MikroTik RouterOS (CVE-2018-14847) allows attackers to extract and decrypt administrative credentials, leading to full system compromise.
CVE search metadata
CVE search record: CVE-2018-14847. Severity: critical. CVSS: 9.1. EPSS: 96.09%. KEV: no. Product: RouterOS (< 6.42.1), Winbox. Brief: Exploitation of CVE-2018-14847 in MikroTik RouterOS. Brief link: https://feed.craftedsignal.io/briefs/2026-08-cve-2018-14847/
CVE-2018-14847 is a critical vulnerability affecting the Winbox service in MikroTik RouterOS, enabling unauthenticated attackers to perform arbitrary file reads. The vulnerability resides in how the service handles file requests, specifically allowing unauthorized access to the 'user.dat' file, which contains device account credentials. The passwords stored within this file are protected by a weak XOR-based obfuscation using a static key derived from a hardcoded salt. Publicly available exploit scripts automate the entire attack chain, from establishing the Winbox session to extracting and decrypting credentials. This vulnerability impacts MikroTik RouterOS versions up to 6.42. Defenders should prioritize patching, as the presence of functional exploit code significantly lowers the barrier for attackers to gain full administrative control over exposed routing infrastructure.
Attack Chain
- The attacker performs network scanning to identify reachable Winbox services on TCP port 8291.
- The attacker establishes an initial session with the Winbox service by sending a crafted 'FIRST_PAYLOAD'.
- The service responds, and the attacker extracts the session ID from the 38th byte of the response.
- The attacker injects the extracted session ID into a 'SECOND_PAYLOAD' at the 19th byte position.
- The attacker sends this second payload to request the sensitive file '/flash/rw/store/user.dat'.
- The service returns the file content to the attacker, including encrypted user credentials.
- The attacker parses the data for 'M2' entries and applies XOR decryption using the MD5 hash of the username concatenated with a hardcoded salt.
- The attacker obtains plain-text administrative credentials and gains full access to the router.
Impact
Successful exploitation results in the immediate exposure of all local administrative credentials stored on the router. Given the high-privilege nature of these accounts, attackers can gain complete control of the network device, leading to traffic interception, modification of network configuration, deployment of backdoors, or the utilization of the compromised router as an entry point for further lateral movement within the organization.
Recommendation
Prioritize patching all internet-facing or internal MikroTik RouterOS devices to the current long-term or stable release versions, specifically ensuring the system is at or above version 6.42.1 (for stable) or 6.40.8 (for long-term). Block external access to TCP port 8291 via perimeter firewalls if Winbox management is not strictly required from remote locations. Use the Sigma rule below to monitor for mass scanning or exploitation attempts targeting the Winbox service.
Immediate actions
Inventory all MikroTik RouterOS assets and verify patch levels.
Restrict access to port 8291 to authorized IP addresses.
Threat Hunt
Identify unauthorized IP connections to port 8291.
Data: Firewall connection logs
Mitigations
Upgrade MikroTik RouterOS to version 6.42.1 or later.
CVE-2018-14847
Detection coverage 1
Detects CVE-2018-14847 Exploitation - Winbox Unauthenticated File Request
highDetects potential exploitation of CVE-2018-14847 by monitoring for unauthorized attempts to read internal system files via the Winbox protocol (Port 8291).
Detection queries are available on the platform. Get full rules →