/

CVE-2026-45088

Severity:

HIGH RISK

(7.5)

Improper File Access / Local File Inclusion via API

CVE-2026-45088

Deferred

Vulnerability type

Category:

Improper File Access / Local File Inclusion via API

CWE:

CWE-73, CWE-306, CWE-552

Impact:

Arbitrary File Read / Data Exfiltration from Scanner Host

Severity:

HIGH RISK

(7.5)

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 previously allowed client-supplied file paths in the custom-payload-file option to be used directly as sources for XSS payloads.

An unauthenticated network attacker could point this option at arbitrary files on the Dalfox host, causing their contents to be read and exfiltrated line-by-line via outbound scan traffic to attacker-controlled targets.

Affected context

This vulnerability affects environments where Dalfox is run in REST API server mode and exposed to a network where untrusted clients can send scan requests.

The issue manifests when:

  • The custom-payload-file field is accepted directly from client JSON input,
  • The Dalfox process has read access to sensitive files on the host (e.g., configuration files, SSH keys, tokens, or logs),
  • Outbound HTTP scan traffic is allowed to reach attacker-controlled domains, enabling the attacker to observe payload content.

It is most concerning when Dalfox runs on shared security tooling servers, CI agents, or other hosts that store secrets and sensitive configuration.

Exploit preconditions

  • Attack surface: Dalfox REST API endpoint that accepts scan configuration (including custom-payload-file) over HTTP.
  • Required access: Network access to the Dalfox REST API server; no API key or authentication is required by default.
  • Trigger point: Submitting a scan request where custom-payload-file is set to a path pointing to a file readable by the Dalfox process.
  • Why exploitation is possible:
  • The custom-payload-file field is bound directly from JSON into internal options without validation.
  • The scan engine passes this path to voltFile.ReadLinesOrLiteral, which reads contents from the specified file on disk.
  • Each line from the file is then used as a payload in outbound HTTP requests to attacker-controlled URLs, effectively leaking file contents via the network.

Why this happens

The core issue is the unrestricted propagation of user-controlled file paths into file read operations without validation or access control, aligning with CWE-73: External Control of File Name or Path.

In Dalfox's REST API mode, the custom-payload-file field is:

  • Directly deserialized from client JSON into model.Options,
  • Passed through dalfox.Initialize into the scan engine without sanitization or whitelisting,
  • Used by voltFile.ReadLinesOrLiteral to open and read arbitrary host files.

This design treats externally supplied file paths as trusted configuration, conflating client-supplied parameters with local operator-controlled settings.

The lack of authentication (related to CWE-306) and inadequate protection of host-resident data (related to CWE-552) amplify the impact, but the primary bug class is uncontrolled file path usage in a server-facing API.

Potential impact

  • An attacker may read the contents of arbitrary files that the Dalfox process can access, including:
  • Application configuration files
  • API keys, tokens, or credential files
  • SSH private keys or deployment keys
  • Source code or internal scripts
  • Sensitive data could be exfiltrated line-by-line through scan payload traffic to attacker-controlled endpoints.
  • Attackers can gain insights into internal network architecture, service endpoints, or debug logs.
  • Exfiltrated secrets may enable lateral movement, further compromise of infrastructure, or impersonation of services.
  • Security tooling integrity can be undermined, eroding trust in scan results and the platform hosting Dalfox.

General mitigation guidance

Durable mitigation focuses on separating untrusted client input from local file system operations and hardening access controls around the API:

  • Treat all file-path-related options as privileged configuration, not as user input in a remote API; avoid exposing them directly over network-facing interfaces.
  • When file-based configuration is necessary, restrict paths to:
  • A fixed, application-controlled directory, and
  • A known allowlist of filenames or patterns.
  • Replace generic file path parameters with higher-level identifiers (e.g., named payload sets) that map to pre-configured resources.
  • Enforce authentication and authorization for the REST API, ensuring only trusted callers can initiate scans and influence configuration-like parameters.
  • Run Dalfox under a dedicated, least-privileged OS account with minimal file system access, and avoid co-locating sensitive secrets on the same host.
  • Consider segregating outbound scan traffic so it cannot be used as a high-bandwidth exfiltration channel (e.g., proxy controls, domain allowlists).

These patterns reduce the blast radius even if an attacker can interact with the API.

How teams detect issues like this

Detection typically combines configuration review, code analysis, and behavioral monitoring:

  • Static analysis and code review:
  • Flag code paths where HTTP/JSON request fields are directly mapped to file system operations such as open, ReadFile, or similar abstractions.
  • Look for API models that expose configuration-like file path fields (e.g., *File, Path, Config) without validation or restriction.
  • Review REST handlers for the use of options structs that were originally intended for CLI-only use.
  • Configuration and deployment checks:
  • Validate that REST API endpoints are not publicly exposed or are protected by authentication and network controls.
  • Check runtime permissions of the Dalfox process (e.g., whether it has access to system-wide secret directories).
  • Runtime monitoring:
  • Monitor for suspicious scan requests where custom-payload-file or similar fields reference unexpected paths (e.g., /etc/passwd, /home/*/.ssh/*).
  • Inspect outbound scan traffic for payloads containing internal file content patterns, secrets, or configuration fragments.
  • Automated security testing and SAST tools can be configured with rules to detect externally controlled file paths and missing authentication controls in API handlers.

Sources

SourceLink
github.comgithub.com/hahwul/dalfox/releases/tag/v2.13.0
github.comgithub.com/hahwul/dalfox/security/advisories/GHSA-35wr-x7v6-9fv2

Frequently asked

questions

Yes. When Dalfox runs in REST API server mode and is reachable over the network, an attacker can exploit the issue remotely by sending crafted JSON requests that specify arbitrary file paths in custom-payload-file.

No local access is required. By default, the REST API does not enforce an API key or authentication, so any party with network reachability to the Dalfox server can attempt exploitation, subject to external network controls or reverse proxies that an operator may have configured.

The strongest fix is to remove or strictly limit the ability of remote clients to control file paths. Treat file-backed options as operator-only configuration, enforce an allowlist of safe resources, and require authentication for any API that can influence scanner behavior in a configuration-like way.

Design APIs under the assumption that all client input is untrusted and must never directly drive file system access, process execution, or other sensitive operations. Introduce clear boundaries between CLI/internal configuration and network-facing parameters, require authentication for powerful endpoints, apply least-privilege principles to the runtime environment, and adopt static analysis or secure code review practices that specifically look for externally controlled file paths.

Find out what's already
exploitable in your codebase.