/

CVE-2026-26213

Severity:

CRITICAL RISK

(9.8)

OS Command Injection (CWE-78) in Thingino Firmware WiFi Captive Portal CGI

CVE-2026-26213

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Root Command Execution and Persistent Device Compromise

Severity:

CRITICAL RISK

(9.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 the firmware-2026-03-16 release contains an unauthenticated OS command injection flaw in the WiFi captive portal CGI script, where HTTP parameter names are evaluated unsafely.

Remote attackers can inject shell commands that run as root, enabling arbitrary command execution, privileged configuration changes, and persistent full device compromise whenever the vulnerable CGI endpoint is exposed over the network.

Affected context

The vulnerability occurs in Thingino-based devices running firmware up to and including the firmware-2026-03-16 release when the WiFi captive portal CGI script is enabled and reachable over the network.

The CGI handler processes HTTP requests for portal-related functionality and uses custom parsing functions (parse_query() and parse_post()) to interpret incoming parameters.

Because parameter names are dynamically evaluated and tied into shell execution logic, any deployment that exposes this CGI endpoint without strong network isolation or upstream filtering is at risk.

Exploit preconditions

  • Attack surface: Network-exposed HTTP interface for the WiFi captive portal CGI.
  • Required access: No prior authentication; the flaw is reachable by any remote party able to send HTTP requests to the device.
  • Trigger point: Submission of specially crafted HTTP requests where malicious shell code is embedded in parameter names or values processed by parse_query() / parse_post().
  • Why exploitation is possible: The implementation uses an eval-style construct that executes derived shell fragments from untrusted HTTP parameters without robust sanitization or strict whitelisting, allowing arbitrary OS commands to be injected into root-level execution paths.

Why this happens

This issue stems from dynamically interpreting untrusted HTTP parameters as part of shell command construction and evaluation within the captive portal CGI logic.

The parse_query() and parse_post() functions rely on eval semantics to process parameter names and values, effectively treating user-controlled input as code.

Because no strict validation, escaping, or canonical mapping of parameter names to safe internal variables is enforced, attackers can inject shell metacharacters and additional commands into the evaluation context.

This behavior maps directly to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where external input is concatenated or interpreted into OS command lines without adequate neutralization.

Potential impact

  • Remote execution of arbitrary OS commands with root privileges on the device.
  • Modification of critical configuration, including resetting the root password.
  • Insertion or alteration of SSH authorized_keys, enabling persistent, passwordless remote access.
  • Disabling or weakening of security controls (firewall rules, logging, update settings).
  • Installation of additional malicious binaries or backdoors that survive reboots.
  • Use of compromised devices as part of larger botnets, DDoS infrastructure, or internal pivot points.

General mitigation guidance

Mitigation typically focuses on removing dynamic command construction and eliminating eval usage on untrusted input within CGI scripts and related components.

Recommended pattern-based defenses include:

  • Refactoring CGI handlers so that HTTP parameter names are mapped via static lookup tables to internal variables or configuration fields, rather than being executed or evaluated.
  • Avoiding direct shell invocation for configuration changes; instead, use language-native APIs or dedicated libraries that abstract OS interactions without invoking a shell.
  • Where shell commands are unavoidable, using parameterized execution (e.g., execve-style APIs with argument arrays) and strict whitelists of acceptable values, rejecting or ignoring unknown parameters.
  • Applying robust input validation and normalization on both parameter names and values, explicitly rejecting unexpected keys, special characters, and shell metacharacters.
  • Running web-facing components under non-root identities with minimal privileges, combined with filesystem permissions that restrict access to sensitive configuration files.
  • Segmenting network access so that administrative or captive-portal interfaces are not directly exposed to untrusted networks whenever possible.

How teams detect issues like this

Detection efforts can combine code-centric, configuration-centric, and runtime approaches:

  • Static analysis and code review:
  • Search for use of eval, backticks, system, popen, or similar APIs in CGI scripts and request-handling code, especially when arguments derive from HTTP parameters.
  • Flag patterns where query string parameters or POST fields are used to construct shell command lines or environment variables without strict whitelisting.
  • Enforce coding policies that prohibit dynamic evaluation of HTTP parameter names and require fixed mappings for all externally visible configuration keys.
  • Configuration and deployment checks:
  • Review web server and CGI configurations to identify endpoints that invoke shell scripts or interpreters, especially those handling captive portal or administrative functions.
  • Verify that sensitive endpoints are restricted (e.g., internal-only, authenticated, or behind VPNs) and that unnecessary CGI functionality is disabled by default.
  • Runtime monitoring:
  • Monitor process executions originating from web server or CGI processes, focusing on unusual commands, arguments, or child processes spawned during HTTP request handling.
  • Collect and analyze logs for anomalous query strings or parameter names containing shell metacharacters or unexpected tokens.
  • Automated tooling:
  • Use security testing tools and HTTP fuzzers configured to inject command injection payloads into both parameter names and values; correlate resulting behavior with process and log observations.

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

The issue is broadly exploitable wherever the vulnerable WiFi captive portal CGI is reachable over the network, because it requires no authentication and processes attacker-controlled HTTP requests. Any device exposing this endpoint to untrusted networks can be targeted remotely.

An attacker only needs network-level access to the device's HTTP interface that serves the captive portal CGI. No valid credentials or prior foothold are required, as the flaw resides in unauthenticated request handling.

The safest pattern is to remove all uses of eval or similar dynamic evaluation constructs on HTTP parameters and to avoid building shell commands from user input. Instead, define a fixed mapping from allowed parameter names to internal operations and implement those operations using safe, non-shell APIs under least-privilege accounts.

Prevention relies on secure coding practices for web interfaces: disallow dynamic evaluation of client input, enforce strict whitelists for all parameters, prefer API-based system interactions over shell calls, and mandate security-focused code reviews for any code that parses HTTP requests. Complement this with automated static analysis rules targeting command injection patterns and continuous testing for injection risks as part of the CI pipeline.

Find out what's already
exploitable in your codebase.