Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-45089 — dalfox

🟠 CVSS 8.2 — High ✅ No Known Exploit NVD
8.2
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Dalfox Server Mode has an Unauthenticated Arbitrary File Create/Append via output Option

Summary

When dalfox is run in REST API server mode, the output, output-all, and debug fields in model.Options are JSON-tagged and deserialized directly from the attacker's request body, then propagated unchanged through dalfox.Initialize into the scan engine's logging path. The logger opens the attacker-supplied path with os.O_APPEND|os.O_CREATE|os.O_WRONLY and writes scan log lines to it. Critically, this file write block lives outside the IsLibrary guard in DalLog, so it executes even in server/library mode where file output was never intended to operate. Because no API key is required in the default configuration, an unauthenticated network caller can create or append to any file writable by the dalfox process on the host filesystem.

Severity

High (CVSS 3.1: 8.2)

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

  • Attack Vector: Network — server binds to 0.0.0.0:6664 by default.
  • Attack Complexity: Low — no preconditions; all trigger options (output, output-all, debug) are fully attacker-supplied in the JSON body.
  • Privileges Required: None — --api-key defaults to "", so the auth middleware is never registered.
  • User Interaction: None.
  • Scope: Unchanged — the file write stays within the dalfox process's OS authority.
  • Confidentiality Impact: None — this is a write-only primitive; no data is returned to the caller.
  • Integrity Impact: High — the attacker has full control over which file path is opened, enabling creation of new files or corruption of existing files anywhere the dalfox process has write permission. While the log content format is semi-fixed, the file path is entirely attacker-determined, making the integrity violation complete with respect to file targeting.
  • Availability Impact: Low — corrupting application configuration files or log files on the host can degrade the availability of other services relying on those files.

Affected Component

  • cmd/server.goinit() (line 51): --api-key defaults to "" — no auth by default
  • pkg/server/server.gosetupEchoServer() (line 68): auth middleware only registered when APIKey != ""
  • pkg/server/server.gopostScanHandler() (lines 173–191): rq.Options (including OutputFile, OutputAll, Debug) passed to ScanFromAPI without sanitization
  • lib/func.goInitialize() (line 107): OutputFile explicitly propagated from caller options; OutputAll (line 167) and Debug (line 176) likewise
  • internal/printing/logger.goDalLog() (lines 230–244): os.OpenFile(options.OutputFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) executes outside the IsLibrary guard

CWE

  • CWE-306: Missing Authentication for Critical Function
  • CWE-73: External Control of File Name or Path
  • CWE-434: Unrestricted Upload of File with Dangerous Type (write-path variant)

Description

output, output-all, and debug Are Fully Attacker-Controlled

model.Options exposes all three trigger fields with JSON tags:

```go

// pkg/model/options.go:88,85,88

OutputFile string json:"output,omitempty"

OutputAll bool json:"output-all,omitempty"

Debug bool json:"debug,omitempty"

```

postScanHandler binds the entire Req.Options from the JSON body and passes it directly to ScanFromAPI:

```go

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

rq := new(Req)

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

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

```

Initialize explicitly copies all three fields into newOptions:

```go

// lib/func.go:107, 167, 176

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

...

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

...

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

```

The File Write Is Not Guarded by IsLibrary

Initialize always sets IsLibrary: true (line 20) and Silence: true (line 44) in its returned options — the intent being that the scan engine runs in embedded/library mode during API calls, suppressing terminal I/O. DalLog does respect this for stderr output: lines 203–228 route logs to ScanResult.Logs (not stderr) when IsLibrary is true. However, the file write block at lines 230–244 is positioned after and outside that if-else:

```go

// internal/printing/logger.go

mutex.Lock()

if options.IsLibrary {

options.ScanResult.Logs = append(options.ScanResult.Logs, text) // API path

} else {

// stderr printing (CLI path)

}

// ← file write is here, unconditionally — no IsLibrary check

if options.OutputFile != "" {

var fdtext string

if ftext != "" {

fdtext = ftext

f, err := os.OpenFile(options.OutputFile,

os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)

if err != nil {

fmt.Fprintln(os.Stderr, "output file error (file)")

}

defer f.Close()

if _, err := f.WriteString(fdtext + "\n"); err != nil

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 unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity high, availability low.

CVSS metrics in full

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

  • 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: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: None.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: Low — limited, and the attacker does not choose what is affected.

Affected software

CVE-2026-45089 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 High
CVSS Score 8.2
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L
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

Site Security Check

Is dalfox part of your stack?

CVE-2026-45089 is rated CVSS 8.2 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

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