The vulnerability is an unauthenticated arbitrary file write in Dalfox's server mode. The root cause is twofold: first, the API handlers (server.postScanHandler for the REST API and an anonymous function in server.RunMCPServer for the MCP API) accepted and processed user-supplied options from a JSON request without proper sanitization. An attacker could specify an arbitrary file path in the output field of the request. Second, the logging function printing.DalLog contained a logic flaw where it would write to the specified file path regardless of whether it was running in a server context (where file I/O should be disabled).
During exploitation, an unauthenticated attacker sends a crafted POST request to the /scan endpoint. The vulnerable handler server.postScanHandler passes the malicious file path to the scan engine. Eventually, the printing.DalLog function is called, which proceeds to open and append to the attacker-specified file on the host filesystem. The patch mitigates this by introducing sanitizeAPIScanOptions, a function that strips dangerous filesystem-related options like OutputFile at the API boundary, preventing the malicious input from ever reaching the vulnerable logging function.