Did you hear the one about Cisco routers using strcpy insecurely for login authentication? Makes you go AAAAA-AAAAAAArrg *segfault*

RV110W, RV130W, RV215W need patching to close remote hijacking bug


Cisco has patched three of its RV-series routers after Pen Test Partners (PTP) found them using hoary old C function strcpy insecurely in login authentication function. The programming blunder can be exploited to potentially hijack the devices.

PTP looked at how the routers' web-based control panel handled login attempts by users, and found that it was alarmingly easy to trigger a buffer overflow by simply supplying a long string of characters as the password, something which Cisco admitted "could allow an unauthenticated, remote attacker to execute arbitrary code on an affected device".

Lobbing in a password of 447 characters, such as 'A', followed by four characters, would allow the hijacker to control a subroutine return address on the web app's stack using the values of those final characters. That means the hacker could force the device's 32-bit Arm-based processor to jump to malicious code stashed in the login request.

An attacker has to be able to reach the web interface – either on the local network, or via the remote administration feature that is admittedly disabled by default.

The three routers affected – the RV110W, RV130W and RV215W – run "some form of embedded Linux" instead of Cisco OS, according to PTP's definitely-not-pseudonymous blogger Dave Null. The network equipment provides physical Ethernet ports as well as Wi-Fi connectivity, firewall protections, and VPN tunneling.

The discovery of the flaw was credited to Yu Zhang and Haoliang Lu at the GeekPwn conference, and T. Shiomitsu of Pen Test Partners, who worked and informed Cisco separately.

Insecurity a-bounds

When following the RV130W's login process at the binary executable level, PTP found that the router was placing the user-inputted password string into a memory buffer, ready for authentication against the saved password, using strcpy with no bounds checks. That means if the password is larger than the buffer size, it will blow past the end of the buffer and overwrite other data and return addresses on the stack.

As El Reg reported years ago when a similarly worrying use of strcpy emerged in glibc: "strcpy is dangerous and an obvious target in an audit because it blindly copies the entire contents of a zero-terminated buffer into another memory buffer without checking the size of the target buffer."

Null from PTP elaborated on Thursday: "If someone else has control over the source string, you are giving an external entity the capability to overwrite the bounds of the memory that you allocated – which might mean they can overwrite something important with something bad. In most exploitable cases, this will mean overwriting a saved return pointer on the stack and redirecting the execution flow of the process."

He cheerily added: "Oh yeah, also, no PIE/ASLR in the binary," meaning it's pretty easy to exploit. Tutorials on how to leverage buffer overflows on embedded Arm-based gadgets can be found here, for instance.

The security patches for the hardware are free to download, and were released earlier this week; you don't need a support contract. Cisco customers should check their routers are running the latest firmware versions, to ensure they are not vulnerable, as follows:

  • RV110W Wireless-N VPN Firewall: 1.2.2.1
  • RV130W Wireless-N Multifunction VPN Router: 1.0.3.45
  • RV215W Wireless-N VPN Router: 1.3.1.1

A decade ago Microsoft banned the use of a superficially similar function, memcopy, from its code. PTP's Null suggested latterday C authors might want to switch to strlcpy instead, "a nonstandard function which takes a third length argument, and always null terminates". ®

Similar topics

Narrower topics


Other stories you might like

  • Stolen university credentials up for sale by Russian crooks, FBI warns
    Forget dark-web souks, thousands of these are already being traded on public bazaars

    Russian crooks are selling network credentials and virtual private network access for a "multitude" of US universities and colleges on criminal marketplaces, according to the FBI.

    According to a warning issued on Thursday, these stolen credentials sell for thousands of dollars on both dark web and public internet forums, and could lead to subsequent cyberattacks against individual employees or the schools themselves.

    "The exposure of usernames and passwords can lead to brute force credential stuffing computer network attacks, whereby attackers attempt logins across various internet sites or exploit them for subsequent cyber attacks as criminal actors take advantage of users recycling the same credentials across multiple accounts, internet sites, and services," the Feds' alert [PDF] said.

    Continue reading
  • Big Tech loves talking up privacy – while trying to kill privacy legislation
    Study claims Amazon, Apple, Google, Meta, Microsoft work to derail data rules

    Amazon, Apple, Google, Meta, and Microsoft often support privacy in public statements, but behind the scenes they've been working through some common organizations to weaken or kill privacy legislation in US states.

    That's according to a report this week from news non-profit The Markup, which said the corporations hire lobbyists from the same few groups and law firms to defang or drown state privacy bills.

    The report examined 31 states when state legislatures were considering privacy legislation and identified 445 lobbyists and lobbying firms working on behalf of Amazon, Apple, Google, Meta, and Microsoft, along with industry groups like TechNet and the State Privacy and Security Coalition.

    Continue reading
  • SEC probes Musk for not properly disclosing Twitter stake
    Meanwhile, social network's board rejects resignation of one its directors

    America's financial watchdog is investigating whether Elon Musk adequately disclosed his purchase of Twitter shares last month, just as his bid to take over the social media company hangs in the balance. 

    A letter [PDF] from the SEC addressed to the tech billionaire said he "[did] not appear" to have filed the proper form detailing his 9.2 percent stake in Twitter "required 10 days from the date of acquisition," and asked him to provide more information. Musk's shares made him one of Twitter's largest shareholders. The letter is dated April 4, and was shared this week by the regulator.

    Musk quickly moved to try and buy the whole company outright in a deal initially worth over $44 billion. Musk sold a chunk of his shares in Tesla worth $8.4 billion and bagged another $7.14 billion from investors to help finance the $21 billion he promised to put forward for the deal. The remaining $25.5 billion bill was secured via debt financing by Morgan Stanley, Bank of America, Barclays, and others. But the takeover is not going smoothly.

    Continue reading

Biting the hand that feeds IT © 1998–2022