Skip to content
RCE Advisory Advanced CVE-2022-26780CVE-2022-26781CVE-2022-26782

InHand Networks InRouter302 libnvram.so nvram_import improper input validation vulnerabilities

The nvram_import function in libnvram.so does not validate configuration values, allowing an attacker to set the user_define_timeout variable to a crafted string. This can cause stack-based buffer overflows in multiple httpd functions, leading to remote code execution.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

Critical 9.9 View original

Multiple improper input validation vulnerabilities exists in the libnvram.so nvramimport functionality of InHand Networks InRouter302 V3.5.4. A specially-crafted file can lead to remote code execution.

Francesco Benvenuto, on Cisco Talos

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, the nvram_import function fails to validate configuration values, allowing overly long strings to be stored and later used in unsafe string operations.

Impact

An attacker could achieve remote code execution on the router, potentially taking full control of the device.

What the attacker needed

Authentication (PR:L in CVSS); ability to upload a configuration file; ability to trigger the vulnerable function

The fix

The vendor has released updated firmware that addresses the vulnerabilities.

How it was found

  1. Upload a configuration file with type 'config' and a filename.
  2. The file is parsed by nvram_import, which updates nvram settings without validation.
  3. Set the user_define_timeout nvram variable to a crafted string with an overly long service name or too many entries.
  4. Trigger the vulnerable function (user_define_init, user_define_print, or user_define_set_item) via a request.
  5. The function processes the malicious value, causing a stack-based buffer overflow.

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 report has not been written yet. The Original tab links to the source.

The router's web server accepts uploaded configuration files and stores settings without checking them properly. An attacker can upload a file that sets a particular setting to a very long value, which overflows a fixed-size memory buffer in the router's software. This can crash the router or let the attacker run their own code on it.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Francesco Benvenuto

View all

152 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.