/

CVE-2026-107202

Severity:

CRITICAL RISK

(9.1)

OS Command Injection (CWE-77) in h-ui Admin API Endpoint

CVE-2026-107202

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-77

Impact:

Root-Level Remote Code Execution

Severity:

CRITICAL RISK

(9.1)

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

A critical command injection vulnerability in the h-ui administrative API allows shell metacharacters in the listen configuration field to become part of firewall command strings.

An authenticated administrator who can submit a crafted configuration value may cause arbitrary operating system commands to execute with root privileges when the application invokes the shell.

A critical command injection vulnerability in the h-ui administrative API allows shell metacharacters in the listen configuration field to become part of firewall command strings.

An authenticated administrator who can submit a crafted configuration value may cause arbitrary operating system commands to execute with root privileges when the application invokes the shell.

Affected context

The vulnerability occurs in h-ui administrative API deployments that:

  • Accept administrator-controlled values for the listen configuration
  • Construct nftables or iptables commands through string formatting
  • Execute those command strings through a shell with root privileges
  • Do not enforce strict port and format validation before command construction

Exploitation generally depends on access to the authenticated administrative configuration workflow.

The vulnerability occurs in h-ui administrative API deployments that:

  • Accept administrator-controlled values for the listen configuration
  • Construct nftables or iptables commands through string formatting
  • Execute those command strings through a shell with root privileges
  • Do not enforce strict port and format validation before command construction

Exploitation generally depends on access to the authenticated administrative configuration workflow.

Exploit preconditions

  • Attack surface: h-ui administrative API
  • Required access: Authenticated administrator privileges or equivalent ability to submit the listen configuration
  • Trigger point: Processing the listen value while generating and applying firewall rules
  • Why exploitation is possible: The value is incorporated into a shell command without sufficient validation or shell-safe argument handling
  • Execution context: The resulting command may run through bash with root privileges
  • Attack surface: h-ui administrative API
  • Required access: Authenticated administrator privileges or equivalent ability to submit the listen configuration
  • Trigger point: Processing the listen value while generating and applying firewall rules
  • Why exploitation is possible: The value is incorporated into a shell command without sufficient validation or shell-safe argument handling
  • Execution context: The resulting command may run through bash with root privileges

Why this happens

The underlying flaw is improper neutralization of special elements in an operating system command.

The application treats a configuration field as trusted data, inserts it into command strings using formatted string construction, and passes the result to a shell. Without strict allowlisting and safe process invocation, shell metacharacters can alter command interpretation. This behavior maps to CWE-77: Improper Neutralization of Special Elements used in a Command.

The underlying flaw is improper neutralization of special elements in an operating system command.

The application treats a configuration field as trusted data, inserts it into command strings using formatted string construction, and passes the result to a shell. Without strict allowlisting and safe process invocation, shell metacharacters can alter command interpretation. This behavior maps to CWE-77: Improper Neutralization of Special Elements used in a Command.

Potential impact

  • An attacker may execute arbitrary operating system commands
  • The application or host could be fully compromised
  • Sensitive data may be read, modified, or deleted
  • Firewall policies could be altered to expose protected services
  • Additional malware or persistence mechanisms could be installed
  • Other systems may be targeted using the host's privileges
  • An attacker may execute arbitrary operating system commands
  • The application or host could be fully compromised
  • Sensitive data may be read, modified, or deleted
  • Firewall policies could be altered to expose protected services
  • Additional malware or persistence mechanisms could be installed
  • Other systems may be targeted using the host's privileges

General mitigation guidance

Mitigation generally focuses on separating data from command logic and minimizing the privileges available to administrative operations.

Common defensive patterns include:

  • Avoiding shell invocation when a direct process or library API is available
  • Passing validated arguments as distinct process parameters rather than composing shell command strings
  • Restricting listen values to an explicit schema, such as approved addresses and numeric ports
  • Applying validation before any command construction or privileged operation
  • Using least-privilege service accounts and narrowly scoped capabilities
  • Treating administrative configuration input as untrusted at every trust boundary
  • Preventing user-controlled values from selecting arbitrary firewall operations

Mitigation generally focuses on separating data from command logic and minimizing the privileges available to administrative operations.

Common defensive patterns include:

  • Avoiding shell invocation when a direct process or library API is available
  • Passing validated arguments as distinct process parameters rather than composing shell command strings
  • Restricting listen values to an explicit schema, such as approved addresses and numeric ports
  • Applying validation before any command construction or privileged operation
  • Using least-privilege service accounts and narrowly scoped capabilities
  • Treating administrative configuration input as untrusted at every trust boundary
  • Preventing user-controlled values from selecting arbitrary firewall operations

How teams detect issues like this

Detection approaches may include:

  • Static analysis rules for shell execution APIs, including bash invocation and command-string construction
  • Searches for formatted strings passed to process execution or shell wrappers
  • Code review checks for configuration values reaching privileged system calls
  • Tests using invalid, unexpected, and shell-sensitive input classes without relying on production systems
  • Runtime monitoring for unusual child processes launched by the administrative service
  • Policy enforcement requiring direct argument-based process execution and strict input schemas

Automated code review and software composition analysis tools may help identify command execution patterns, but findings should be validated against the actual data flow and privilege context.

Detection approaches may include:

  • Static analysis rules for shell execution APIs, including bash invocation and command-string construction
  • Searches for formatted strings passed to process execution or shell wrappers
  • Code review checks for configuration values reaching privileged system calls
  • Tests using invalid, unexpected, and shell-sensitive input classes without relying on production systems
  • Runtime monitoring for unusual child processes launched by the administrative service
  • Policy enforcement requiring direct argument-based process execution and strict input schemas

Automated code review and software composition analysis tools may help identify command execution patterns, but findings should be validated against the actual data flow and privilege context.

Sources

SourceLink
github.comgithub.com/jonssonyan/h-ui

Frequently asked

questions

It may be exploitable through the administrative API when that interface is network-accessible and the attacker has the required administrative authentication.

The described attack path requires authenticated administrator-level access, or another capability that permits changing the listen configuration.

The safest pattern is to avoid shell command construction, use a direct firewall-management API or argument-based process invocation, and enforce a strict allowlist for valid listen values.

Treat configuration input as untrusted, validate it against a narrow schema, prohibit shell interpolation, review privileged execution paths, and run services with only the capabilities they require.

It may be exploitable through the administrative API when that interface is network-accessible and the attacker has the required administrative authentication.

The described attack path requires authenticated administrator-level access, or another capability that permits changing the listen configuration.

The safest pattern is to avoid shell command construction, use a direct firewall-management API or argument-based process invocation, and enforce a strict allowlist for valid listen values.

Treat configuration input as untrusted, validate it against a narrow schema, prohibit shell interpolation, review privileged execution paths, and run services with only the capabilities they require.

Find out what's already
exploitable in your codebase.