Public Vulnerability Reports

Linksys WRT54G 'upgrade.cgi' Firmware Upload Design Error Vulnerability

09.13.05

BACKGROUND

The Linksys WRT54G is a combination wireless access point, switch and
router. More information is available at the following URL:

  http://www.linksys.com/products/product.asp?prid=508

DESCRIPTION

Remote exploitation of a design error in the upgrade.cgi component of
Cisco Systems Inc.'s Linksys WRT54G wireless router may allow
unauthenticated modification of the router firmware.

The vulnerability specifically exists in the "POST" method of the
upgrade.cgi handler. The httpd running on the internal interfaces,
including by default the wireless interface, does not check if
authentication has failed until after data supplied by an external user
has been processed. The upgrade.cgi handler allows a user to upload new
firmware, which contains the operating system and applications, into the
non-volatile memory of the router.

If the user is authenticated, the router will then restart, and the new
firmware will be loaded. If the user is not authenticated, they will
receive an error page when they attempt to upload a new firmware without
supplying authentication and the router will not reboot. The firmware
will be saved, but will not take effect until the next time the router
restarts.

ANALYSIS

Successful exploitation of this vulnerability would allow an
unauthenticated user the ability to completely compromise the affected
router, by installation of an arbitrary firmware. As the source code and
tools for compiling the firmware are available from the vendor, an
attacker could simply rebuild the firmware and add the extra
functionality. Exploitation of this vulnerability would require that an
attacker connect to the web management port of the router. The httpd is
running by default but is only accessible via the LAN ports or the WLAN
(wireless LAN). For the uploaded firmware to be enabled, the router
must be restarted.

DETECTION

iDEFENSE has confirmed the existence of this vulnerability in version
3.01.03 of the firmware of the Linksys WRT54G wireless router, and has
identified the same code is present in versions 3.03.6 and 4.00.7.
All versions prior to 4.20.7 may be affected.

WORKAROUND

To mitigate exposure of the internal network to outside attackers,
ensure encryption is enabled on the wireless interface. The exact
settings to use are dependent on your wireless deployment policies.
  

VENDOR RESPONSE

Linksys has addressed this issue in version 4.20.7 of the firmware for the WRT54G Router.

Additionally, this vulnerability was fixed in version 1.05.2 of the WRT54GS router, with version 4 hardware.

CVE INFORMATION

A Mitre Corp. Common Vulnerabilities and Exposures (CVE) number has not
been assigned yet.

DISCLOSURE TIMELINE

07/05/2005 Initial vendor notification
07/25/2005 Initial vendor response
09/13/2005 Coordinated public disclosure

CREDIT

This vulnerability was discovered by Greg MacManus of iDEFENSE Labs.

Get paid for vulnerability research
http://www.idefense.com/poi/teams/vcp.jsp

Free tools, research and upcoming events
http://labs.idefense.com

LEGAL NOTICES

Copyright © 2005 Verisign, Inc.

Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDEFENSE. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email customerservice@idefense.com for permission.

Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.