/

CVE-2026-22209

Severity:

HIGH RISK

(8.8)

OS Command Injection in Thingino Firmware WiFi Captive

CVE-2026-22209

Modified

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution as root with persistent device compromise

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Thingino firmware up to commit e3f6a41 contains an unauthenticated OS command injection vulnerability in the WiFi captive portal CGI script, where HTTP parameter names are passed into eval without proper sanitization.

A remote attacker can send crafted HTTP requests to execute arbitrary commands as root, enabling privileged configuration changes such as root password reset and SSH key modification, leading to full persistent device compromise.

Affected context

The vulnerability resides in the WiFi captive portal CGI handler of Thingino firmware builds up to commit e3f6a41.

It manifests when the CGI script processes HTTP requests and parses query string or POST data using eval-based logic that operates directly on user-controlled parameter names.

Devices exposing the captive portal HTTP interface without additional network isolation or authentication are most at risk, especially when reachable from untrusted networks such as guest WiFi or the internet.

Exploit preconditions

  • Attack surface: HTTP interface of the WiFi captive portal CGI script.
  • Required access: Network reachability to the captive portal endpoint; no prior authentication required.
  • Trigger point: Processing of crafted HTTP requests whose parameter names contain injected shell syntax.
  • Why exploitation is possible: The parse_query() and parse_post() functions use eval on data derived from HTTP parameter names without sufficient validation or escaping, allowing attacker-controlled strings to be interpreted as shell commands under root privileges.

Why this happens

The core issue is the use of eval on untrusted input in the CGI script's request parsing logic.

The parse_query() and parse_post() functions build expressions from HTTP parameter names and then evaluate them, implicitly trusting that these names are benign identifiers.

Because the parameter names are not strictly validated or constrained to a safe character set and structure, attackers can inject shell metacharacters or code fragments that are executed by the underlying system.

This pattern aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command, where user input is incorporated into commands or evaluated in a way that allows arbitrary command execution.

Potential impact

  • Execution of arbitrary OS commands as root on the device.
  • Full compromise of device configuration and firmware-level settings.
  • Unauthorized root password reset, locking out legitimate administrators.
  • Unauthorized modification of SSH authorized_keys to establish persistent backdoor access.
  • Use of compromised devices as a foothold for lateral movement within the local network.
  • Deployment of malware, proxies, or traffic interception capabilities on affected devices.

General mitigation guidance

Effective mitigation focuses on eliminating the use of eval with untrusted data and strictly mediating all interactions with the operating system:

  • Replace eval-based parsing in CGI handlers with explicit, structured parsing that treats parameter names and values as data, not code.
  • Constrain allowable parameter names to a strict, whitelisted character set and validate them against expected schemas.
  • When interaction with the shell or OS is required, use parameterized APIs (e.g., exec-like calls with argument arrays) and avoid building shell command strings.
  • Run network-facing services with the least privileges necessary instead of root, and compartmentalize configuration update logic.
  • Introduce a clear authentication and authorization layer for configuration changes, including password and SSH key management.
  • Harden default device configuration by disabling or restricting captive portal access from untrusted networks where feasible.

How teams detect issues like this

Several complementary strategies can help identify and monitor for this class of vulnerability:

  • Static analysis: Scan CGI scripts and associated code for eval usage, dynamic command construction, and unsanitized flow from HTTP parameters into system or shell APIs.
  • Code review: Flag any control paths where parameter names or values influence command strings, environment variables, or evaluation contexts; pay particular attention to parsing utilities such as parse_query()/parse_post().
  • Security testing: Use fuzzing or targeted penetration tests against captive portal endpoints to detect command injection behaviors, observing for unexpected responses or side effects on the device.
  • Runtime monitoring: Where possible, monitor process invocation patterns on devices (e.g., unusual shell or system command activity originating from the web/CGI process).
  • Policy enforcement: Integrate secure coding guidelines into CI pipelines that disallow eval on request-derived data and require strict sanitization for all OS-level interactions.

Sources

SourceLink
github.comgithub.com/themactep/thingino-firmware/releases/tag/firmware-2026-03-15
vulncheck.comvulncheck.com/advisories/thingino-firmware-api-cgi-unauthenticated-command-injection-in-captive-portal

Frequently asked

questions

Yes. Any attacker who can reach the WiFi captive portal HTTP interface can exploit the vulnerability, as it does not require prior authentication.

Successful exploitation results in arbitrary command execution with root privileges on the device, enabling full control and persistent compromise.

Remove all uses of eval on request-derived data in the captive portal CGI code, enforce strict parsing of HTTP parameters, and ensure any interaction with the operating system uses safe, parameterized APIs rather than shell command strings.

Adopt a secure coding standard that prohibits eval on untrusted input, mandates input validation and whitelisting for all HTTP parameters, enforces least-privilege execution for web services, and incorporates static analysis and security review into the development and release process for all network-facing components.

Find out what's already
exploitable in your codebase.