Summary
OpenChamber contains an unauthenticated OS command injection vulnerability in the /api/fs/exec endpoint, where caller-controlled commands are passed directly to the operating system. When UI_PASSWORD is not configured, remote attackers may execute arbitrary shell commands as the application user and receive command output, error details, and exit status in the response.
Affected context
The vulnerability occurs in OpenChamber deployments that expose the filesystem execution API and do not configure UI_PASSWORD. In that configuration, authentication enforcement may become ineffective, allowing network clients to reach the command execution functionality without prior authorization. The risk is particularly significant in default or otherwise internet-accessible Docker deployments.
Exploit preconditions
- Attack surface: Network-accessible HTTP API
- Required access: No authentication when
UI_PASSWORDis unset and the authentication middleware is inactive - Trigger point: A request to the
/api/fs/execendpoint - Why exploitation is possible: Request-controlled command data is passed to Node.js process execution without an allowlist, blocklist, or sufficient argument validation
- Execution context: Commands run with the privileges of the OpenChamber application user
Why this happens
The underlying flaw is direct use of operating-system command execution with attacker-controlled input. The endpoint does not constrain executable names or arguments before passing them to Node.js spawn(), and authentication may provide no protection when its password configuration is absent. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because untrusted request data reaches a command execution interface without an effective trust boundary.
Potential impact
- An unauthenticated attacker may execute arbitrary commands on the host or container
- Attackers could read, modify, or delete files available to the application user
- Sensitive environment variables, credentials, and configuration data may be exposed
- The application or its surrounding container environment could be compromised
- Attackers may use the foothold for lateral movement or disruption
- Command output, standard error, and exit status may disclose operational details
General mitigation guidance
Mitigation generally focuses on removing general-purpose command execution from unauthenticated application paths and reducing trust in request data.
Common defensive patterns include:
- Replacing shell or generic process execution with narrowly scoped application functions
- Enforcing a strict allowlist of permitted operations, executables, and typed arguments where process execution is unavoidable
- Applying authentication and authorization checks independently of optional password configuration
- Requiring secure-by-default authentication and preventing unauthenticated access to administrative APIs
- Running the application with a dedicated least-privilege account and restricting filesystem, network, and container capabilities
- Avoiding reflection of command output and error details unless they are required and appropriately filtered
- Using isolation controls, read-only paths, and restricted service identities to limit the consequences of command execution
How teams detect issues like this
Detection can combine source review, runtime monitoring, and deployment policy enforcement.
Useful approaches include:
- Static analysis rules for request data flowing into
spawn(),exec(), shell wrappers, or equivalent process APIs - Code review checks for filesystem or administrative endpoints that accept executable names or free-form command arguments
- Tests verifying that authentication remains enforced when optional password or secret settings are missing
- API gateway or reverse-proxy policies blocking unauthenticated access to command, filesystem, and administrative routes
- Runtime monitoring for unexpected child processes, command-line patterns, and access to sensitive files
- Container and host telemetry correlating API requests with newly created processes
- Automated security review tools that flag command execution sinks and missing authorization checks

