Details
No X-API-KEY header is required. The reflective server is attacker-controlled and guarantees the vrs = true condition that triggers the channel write.
Impact
- Complete server process crash on a single unauthenticated POST request — no login, no API key, no special permissions required.
- All in-flight scans are lost without results.
- The server requires a manual restart; under automated process managers (systemd, Docker
--restart=always) repeated triggering can create a denial-of-service loop. - The attack requires only network access to port 6664 and a reflective HTTP server reachable by the dalfox instance — both attacker-controlled conditions.
Recommended Remediation
Option 1: Allocate a fresh results channel for the second stage (preferred)
The simplest and most direct fix: give each stage its own channel and consumer. The second stage should not reuse a channel that was created and closed for the first stage.
// pkg/scanning/parameterAnalysis.go — replace the second stage block:
var wggg sync.WaitGroup
paramsDataQue := make(chan string, concurrency)
results2 := make(chan model.ParamResult, concurrency) // fresh channel
go func() {
for result := range results2 {
mutex.Lock()
params[result.Name] = result
mutex.Unlock()
}
}()
for j := 0; j < concurrency; j++ {
wggg.Add(1)
go func() {
processParams(target, paramsDataQue, results2, options, rl, miningCheckerLine, pLog)
wggg.Done()
}()
}
// ... feed paramsDataQue ...
close(paramsDataQue)
wggg.Wait()
close(results2) // close after all writers are done
Option 2: Merge both parameter maps before the single worker stage
Process p and dp entries through a single shared paramsQue and results, eliminating the two-stage design:
// Before the worker loop, merge dp into p (or into a unified queue):
for k := range dp {
// feed to the same paramsQue along with p entries
}
// Then run a single close(paramsQue) → wgg.Wait() → close(results)
This is a more invasive refactor but removes the structural root cause. The current two-stage design is the fundamental source of the ordering bug.
Option 3: Add a recover in processParams goroutines (stopgap only)
Catching the panic prevents the process from crashing but does not fix the lost results or the channel invariant violation. Recommended only as a temporary defensive measure while the channel lifecycle is corrected:
go func() {
defer func() {
if r := recover(); r != nil {
printing.DalLog("ERROR", fmt.Sprintf("processParams panic recovered: %v", r), options)
}
wggg.Done()
}()
processParams(target, paramsDataQue, results, options, rl, miningCheckerLine, pLog)
}()
Option 1 is the recommended primary fix. Option 3 should be combined with Option 1, not used as a substitute.
Credit
This vulnerability was discovered and reported by bugbunny.ai.