Skip to content
Access control Write-up Intermediate

RouterOS: User with just “ftp” policy can create or overwrite arbitrary .rsc files via the /export command [CVE-2021–27221]

A user account with only the 'ftp' policy could use the /export command to create or overwrite arbitrary .rsc files on the router's filesystem, despite lacking the 'write' policy. This allowed such users to fill the filesystem and potentially crash RouterOS.

Ondřej Nový Follow

Published on systemweakness.com

I think I found security issue in RouterOS from Mikrotik company. I reported it as SUP-41598 on 2021–02-15.

Ondřej Nový, on systemweakness.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

Impact

Users without write policy could overwrite existing .rsc files and fill the filesystem, hypothetically crashing RouterOS.

What the attacker needed

A RouterOS user account with 'ftp' policy; no 'write' policy on that account

How it was found

  1. Log in to RouterOS with a user account that has the 'ftp' policy but not the 'write' policy.
  2. Run the command /export file=<filename> to create a file with the .rsc extension.
  3. If the file already exists, it is overwritten.
  4. Repeat the command with random filenames to fill the filesystem.

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.

RouterOS is the operating system for MikroTik routers. It has user accounts with different permissions, called policies. One policy, 'ftp', is meant to allow file transfers but not to change the router's configuration. The bug is that the /export command, which saves the configuration to a file, did not check for the 'write' policy, so a user with only 'ftp' could still create or overwrite files, which they should not be able to do.

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.

More by Ondřej Nový

View all

1 more disclosed report, best first.

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.