/

CVE-2026-72580

Severity:

CRITICAL RISK

(9.8)

OS Command Injection (CWE-78) in XiaoAI Patch API

CVE-2026-72580

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution

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

A critical OS command injection vulnerability in the duhow/xiaoai-patch API allows user-controlled input from the /mute and /unmute endpoints to reach a system shell without adequate sanitization. A remote attacker who can reach an affected Xiaomi smart speaker and invoke these endpoints may execute arbitrary operating-system commands.

Affected context

The vulnerability occurs in Xiaomi smart speakers running an affected xiaoai-patch deployment where the API exposes the /mute or /unmute handlers. Risk depends on network exposure, endpoint accessibility, and whether the silent query parameter is accepted from an untrusted caller and passed to shell execution.

Exploit preconditions

  • Attack surface: Network-accessible HTTP API endpoints
  • Required access: Ability to reach and invoke the affected /mute or /unmute endpoint; authentication requirements depend on deployment configuration
  • Trigger point: Processing of the user-supplied silent query parameter
  • Why exploitation is possible: The parameter is passed to os.system() without adequate validation or shell-safe handling, allowing shell interpretation of attacker-controlled input

Why this happens

The underlying bug is direct incorporation of untrusted request data into an operating-system command. Passing the silent parameter to os.system() creates a shell execution boundary where metacharacters and command syntax may be interpreted rather than treated as ordinary data. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command.

Potential impact

  • An attacker may execute arbitrary commands with the privileges of the API process
  • The speaker could be compromised or rendered unavailable
  • Local configuration, credentials, or user data could be accessed
  • The device could be used for lateral movement or as part of a botnet
  • Connected services or nearby network assets could be exposed

General mitigation guidance

Mitigation generally focuses on removing shell interpretation from request-processing paths and reducing exposure of device-control APIs.

Common defensive patterns include:

  • Replacing shell execution with a direct library or system API that accepts structured arguments
  • Treating the silent value as a strict boolean or allowlisted option rather than a command fragment
  • Applying server-side type validation and rejecting unexpected input before any system interaction
  • Enforcing authentication, authorization, and network segmentation for device-control endpoints
  • Running the service with the minimum operating-system privileges and restricting filesystem and network access
  • Avoiding reliance on escaping alone when a non-shell implementation is available

How teams detect issues like this

Organizations can identify similar issues through:

  • Static analysis rules flagging request parameters passed to os.system(), shell execution APIs, or subprocess calls with shell interpretation
  • Code review checks for data flow from HTTP query parameters into command construction
  • Tests that verify strict type and allowlist validation for control parameters
  • Runtime monitoring for unusual child-process creation by the API service
  • Network policy enforcement that limits access to administrative and device-control endpoints
  • Automated security review tools that track untrusted input reaching command-execution sinks

Sources

SourceLink
github.comgithub.com/duhow/xiaoai-patch
github.comgithub.com/duhow/xiaoai-patch/blob/main/api/main.py

Frequently asked

questions

Yes, when the affected API is reachable over a network and the caller can invoke the vulnerable endpoints. Actual exposure depends on network placement and access controls.

Not necessarily. The key requirement is the ability to reach the affected endpoints and supply request data; whether authentication is required depends on the deployment.

Avoid shell commands for device-control operations. Use a direct API or library call and constrain the input to a validated boolean or predefined value.

Enforce strict input validation, prohibit untrusted data from reaching shell execution APIs, apply least privilege, and use static analysis and runtime monitoring to detect unsafe command construction.

Find out what's already
exploitable in your codebase.