support.mikro.strouter help over vpn
since 2014 Contact us now

Router vulnerability note - Tenda

Tenda G300-F: the diagnostics page that runs curl for you

What happened

The WAN diagnostic function on the G300-F exists so that you can press a button and find out whether the router can reach something. It does that by assembling a command line for curl and running it in a shell. The input — the address you asked it to check — goes into that command line without adequate neutralisation, so extra shell syntax travels with it and executes with the privileges of the management process.

There is a whole family of bugs like this across every vendor's firmware, and it is worth understanding why they keep shipping: the diagnostic page is the one screen a support technician uses constantly and a security reviewer rarely thinks about. It takes user text, it is meant to be helpful, and the cheapest way to write it in C on a small device is to build a string and hand it to a shell.

Who is affected

Tenda G300-F firmware 16.01.14.2 and prior.

Check it yourself

Version, and whether the page is reachable from outside

Tenda UI: System Settings > Firmware upgrade  (shows the current build)
$ curl -s -o /dev/null -w '%{http_code}\n' http://192.168.0.1/index.html
# from a phone on mobile data, try the same URL with your public IP:
# an answer there means the management page is exposed

Do this

  • Update to a build newer than 16.01.14.2 before doing anything else.
  • Do not expose the Tenda management page to the internet; on this class of device, that is the fix, not the CVE.
  • Use the diagnostics page yourself before a visitor does, and note what it is actually testing.
  • Set an admin password that is not printed on a sticker on the underside of the unit.

How we handle it

On Tenda and similar boxes we work with you at the keyboard for most of the visit — the device has no SSH, so the tunnel gets us to the page rather than into a shell. That is enough for a diagnosis and, honestly, for most fixes.

Sources

Not your thing? We can run these checks for you over an OpenVPN tunnel: €45 fix visit, or just mail us.