Skip to content
Access control Write-up Advanced

MikroTrick: Inside the RouterOS Takeover Chain

Two flaws in MikroTik RouterOS let an unauthenticated attacker bypass SSH authentication and then gain full administrative access by supplying a crafted username. Attackers exploited this chain in the wild before patches were available, and compromised routers could expose traffic and credentials.

bishopfox.com

Published on bishopfox.com

On September 5, 2026, CERT Polska published an advisory for six vulnerabilities in MikroTik RouterOS, including vulnerabilities attackers could combine into the "MikroTrick" takeover chain. MikroTik addressed all six in the same security releases, and evidence indicates that attackers were exploiting affected routers…

The author, on bishopfox.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the SSH service failed to enforce that a session had completed authentication before allowing protocol requests, and it passed the client-supplied username to a login helper that interpreted a leading dash as a request to read a trusted identity record from a file descriptor.

Impact

An unauthenticated attacker could gain full administrative control of internet-exposed MikroTik routers, and field evidence showed persistent unauthorised accounts and scheduled tasks on real devices; patching prevents new exploitation but does not remove existing attacker access.

What the attacker needed

Internet-exposed SSH service; vulnerable RouterOS 7.x build; no credentials needed

The fix

RouterOS was fixed in versions 6.49.21, 7.23.4, and 7.24.2 by adding a session-policy check before dispatching connection-layer requests and by rejecting usernames that begin with a dash or contain control characters.

How it was found

  1. Connect to the router's SSH service without authenticating.
  2. Ask the server to renegotiate encryption keys (rekey).
  3. After rekey, open a session channel and request a terminal.
  4. Submit a username beginning with a dash to make the login helper read a trusted identity record from the client's terminal.
  5. Provide a record identifying the administrator with full permissions, which the helper installs without normal authentication.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Routers run software that lets administrators log in remotely, usually with a password. Here, a bug let someone skip the password step and then trick the login program into treating them as the administrator. That means an attacker on the internet could take full control of the router without knowing any credentials.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.