/

CVE-2026-45087

Severity:

CRITICAL RISK

(10.0)

Command Injection in Dalfox REST API Server

CVE-2026-45087

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-15, CWE-78, CWE-306

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(10.0)

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

Dalfox's REST API server mode allows attacker-controlled JSON to populate shell command options (FoundAction and FoundActionShell) that are executed on the host when scan findings occur.

When the server is exposed and no API key is configured, any unauthenticated caller who can reach the port can trigger arbitrary command execution under the Dalfox process account.

Affected context

This vulnerability manifests when Dalfox is run in REST API server mode (dalfox server) and left listening on its default interface and port (0.0.0.0:6664) without requiring an API key.

In this configuration, the /scan endpoint accepts JSON bodies that are mapped directly into internal scan options, including callback-style actions that execute shell commands on the host.

Environments where the Dalfox server is reachable from untrusted networks or shared internal segments are particularly exposed, as untrusted clients can influence post-finding actions.

Exploit preconditions

  • Attack surface: HTTP REST API at /scan on the Dalfox server port (default 6664)
  • Required access: Network connectivity to the Dalfox server; no authentication needed if --api-key is not configured
  • Trigger point: Submission of crafted JSON in a POST request to /scan that sets FoundAction / FoundActionShell
  • Why exploitation is possible: The server directly deserializes attacker-supplied JSON into model.Options, and dalfox.Initialize propagates FoundAction and FoundActionShell into runtime scan options without sanitization or policy checks, allowing arbitrary shell commands to be executed when a scan finding occurs

Why this happens

The core issue lies in binding untrusted configuration input directly to executable behavior, a pattern that spans multiple weakness classes.

The REST API deserializes request JSON into shared configuration structures (model.Options) that are later used to define post-finding actions.

By allowing clients to specify FoundAction and FoundActionShell dynamically, the application blends configuration and control: untrusted data becomes part of a shell command executed by the Dalfox process.

This behavior aligns with:

  • CWE-78 (OS Command Injection): External input is incorporated into OS-level command execution mechanisms without adequate validation or restriction.
  • CWE-15 (External Control of System or Configuration Setting): Attackers can control runtime options that define how the system behaves in response to scan findings.
  • CWE-306 (Missing Authentication for Critical Function): The ability to define and trigger these actions is exposed via an unauthenticated endpoint when no API key is supplied.

Potential impact

  • Remote execution of arbitrary OS commands under the identity of the Dalfox process
  • Complete takeover of the host running the Dalfox server, subject to process privileges
  • Creation of network backdoors, pivot points, or staging environments for further attacks
  • Exfiltration or destruction of local files and data accessible to the Dalfox process
  • Abuse of Dalfox as an internal attack tool to scan or attack other services

General mitigation guidance

Effective mitigation centers on separating untrusted input from executable actions and reducing exposure of control surfaces:

  • Treat post-finding actions as server-side configuration only, not client-supplied options; reject or ignore these fields for API clients.
  • Constrain any shell execution paths with strict allowlists of commands or eliminate shell invocation in favor of safer, parameterized APIs.
  • Require strong authentication for any endpoint that influences runtime behavior, and default to secure configurations (e.g., binding only to localhost, requiring an API key).
  • Apply least-privilege principles to the Dalfox process, reducing the blast radius if command execution occurs (limited filesystem and network access).
  • Introduce validation and policy enforcement layers that explicitly forbid or strip dangerous options from incoming requests.

How teams detect issues like this

Detection can focus on both code-level patterns and runtime behavior:

  • Static analysis and code review:
  • Flag deserialization of request bodies directly into option/config objects that feed into command execution or callbacks.
  • Look for usages of FoundAction, FoundActionShell, or similar fields where values can originate from HTTP requests.
  • Identify any shell execution functions (e.g., exec, os/exec, or equivalent) that accept parameters not clearly constrained by server-side configuration.
  • Runtime and operational monitoring:
  • Monitor Dalfox server logs and HTTP access logs for unusual or repeated POST requests to /scan from unrecognized sources.
  • Instrument process-level monitoring to detect unexpected child processes or commands spawned by the Dalfox process.
  • Implement WAF or API gateway rules to restrict access and inspect suspicious payloads targeting control-related fields.
  • Policy and tooling:
  • Use automated security scanning tools or linters that highlight unvalidated command execution paths and missing authentication on critical endpoints.
  • Enforce configuration baselines (e.g., local binding, mandatory API key) through infrastructure-as-code and deployment policies.

Sources

SourceLink
github.comgithub.com/hahwul/dalfox/releases/tag/v2.13.0
github.comgithub.com/hahwul/dalfox/security/advisories/GHSA-v25v-m36w-jp4h

Frequently asked

questions

Yes. If the Dalfox REST API server is bound to an address reachable from an attacker and no API key is required, an attacker can send crafted HTTP requests to /scan to achieve remote command execution.

Not necessarily. When the server is started without an API key and listens on 0.0.0.0:6664, the /scan endpoint is effectively unauthenticated, so any party with network access to that port can attempt exploitation.

Restrict command-capable options to trusted, server-side configuration and enforce strict authentication around any functionality that can influence runtime behavior.

Additionally, avoid constructing shell commands from user-controllable input, preferring safer APIs that accept structured parameters with explicit validation.

Design APIs so that untrusted clients cannot define or override execution behavior: separate configuration from input, enforce authentication and authorization on control endpoints, and apply robust input validation.

During development, treat any path from request data to command execution, shell invocation, or callback registration as high risk and subject to stringent security review and automated checks.

Find out what's already
exploitable in your codebase.