Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-45087 — dalfox

🔴 CVSS 10.0 — Critical ✅ No Known Exploit NVD
10.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Dalfox Server Mode Vulnerable to Unauthenticated Remote Code Execution via found-action

# GHSA: Unauthenticated Remote Code Execution via found-action in Dalfox Server Mode

Summary

When dalfox is started in REST API server mode (dalfox server), the server binds to 0.0.0.0:6664 by default and requires no API key unless the operator explicitly passes --api-key. Because model.Options — including FoundAction and FoundActionShell — is deserialized directly from attacker-supplied JSON in POST /scan, and because dalfox.Initialize explicitly propagates those two fields into the final scan options without stripping them, any unauthenticated caller who can reach the server port can supply an arbitrary shell command that the dalfox process will execute on the host whenever a scan finding is triggered.

Severity

Critical (CVSS 3.1: 10.0)

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

  • Attack Vector: Network — the server binds to 0.0.0.0 by default; reachable by any network peer.
  • Attack Complexity: Low — the attacker fully controls the scanned URL and can trivially host a one-line reflective server to guarantee a finding is triggered.
  • Privileges Required: None — no API key is enforced in the default configuration.
  • User Interaction: None.
  • Scope: Changed — exploitation escapes the dalfox process boundary and executes arbitrary commands on the host OS.
  • Confidentiality Impact: High — full read access to the host filesystem and secrets in the process environment.
  • Integrity Impact: High — arbitrary file writes, code deployment, persistence mechanisms.
  • Availability Impact: High — process kill, resource exhaustion, service disruption.

Affected Component

  • cmd/server.goinit() (line 51): --api-key defaults to ""
  • pkg/server/server.gosetupEchoServer() (line 68): auth middleware only registered when APIKey != ""
  • pkg/server/server.gopostScanHandler() (lines 173–191): rq.Options passed to ScanFromAPI without sanitization
  • lib/func.goInitialize() (lines 118–119): FoundAction / FoundActionShell explicitly propagated from caller options
  • pkg/scanning/foundaction.gofoundAction() (lines 17–18): exec.Command(options.FoundActionShell, "-c", afterCmd) executed unconditionally

CWE

  • CWE-306: Missing Authentication for Critical Function
  • CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
  • CWE-15: External Control of System or Configuration Setting

Description

Opt-in Authentication with a Dangerous Default

cmd/server.go registers the --api-key flag with an empty string default:

```go

// cmd/server.go:51

serverCmd.Flags().StringVar(&apiKey, "api-key", "", "Specify the API key for server authentication...")

```

setupEchoServer only installs the apiKeyAuth middleware when that value is non-empty:

```go

// pkg/server/server.go:68-70

if options.ServerType == "rest" && options.APIKey != "" {

e.Use(apiKeyAuth(options.APIKey, options))

}

```

A server started without --api-key accepts every request on every route with no challenge. The apiKeyAuth implementation itself is correct — the flaw is purely in the opt-in condition that makes authentication off by default.

Attacker-Controlled Options Reaches Shell Execution Without Stripping

POST /scan deserializes the full model.Options struct from the JSON body:

```go

// pkg/server/model.go:6-8

type Req struct {

URL string json:"url"

Options model.Options json:"options"

}

// pkg/server/server.go:173-191

rq := new(Req)

if err := c.Bind(rq); err != nil { ... }

go ScanFromAPI(rq.URL, rq.Options, *options, sid)

```

model.Options exposes both execution-control fields as JSON-tagged properties:

```go

// pkg/model/options.go:83-84

FoundAction string json:"found-action,omitempty"

FoundActionShell string json:"found-action-shell,omitempty"

```

ScanFromAPI builds the scan target directly from rqOptions and passes it to dalfox.Initialize:

```go

// pkg/server/scan.go:22-27

target := dalfox.Target{

URL: url,

Method: rqOptions.Method,

Options: rqOptions,

}

newOptions := dalfox.Initialize(target, target.Options)

```

Initialize explicitly copies both fields into newOptions — there is no stripping path:

```go

// lib/func.go:118-119

"FoundAction": {&newOptions.FoundAction, options.FoundAction},

"FoundActionShell": {&newOptions.FoundActionShell, options.FoundActionShell},

```

Shell Execution on Any Finding

foundAction is called from seven locations across pkg/scanning/scanning.go and pkg/scanning/sendReq.go whenever options.FoundAction != "" and any vulnerability is detected. None of these call sites check options.IsAPI:

```go

// pkg/scanning/foundaction.go:12-18

func foundAction(options model.Options, target, query, ptype string) {

afterCmd := options.FoundAction

afterCmd = string

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality high, integrity high, availability high.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Changed — a successful attack reaches components beyond the vulnerable one.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: High — total loss, or loss the attacker controls.

Affected software

CVE-2026-45087 is recorded against 3 packages.

  • github.com/hahwul/dalfox
  • github.com/hahwul/dalfox/v2
  • unknown

Timeline and source

Published on 25 June 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Advisory)
nvd.nist.gov (Advisory)
github.com (Web)

Other advisories for this package

github.com/hahwul/dalfox has other advisories on record. If you are patching this one, these are worth checking on the same host:

Details

Severity Critical
CVSS Score 10.0
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
CWE N/A
Public Exploit ✅ No
Source NVD
Published 2026-06-25
Updated 2026-08-20
Modified 2026-06-25
Fix URL N/A

Affected Packages

Software From version Fixed in
github.com/hahwul/dalfox
github.com/hahwul/dalfox/v2
unknown

Similar Threats

Exploit Protection

Are you running dalfox?

CVE-2026-45087 carries CVSS 10.0 Critical rating. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-45087 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026