A vulnerability in Nuclei's JavaScript MySQL client library allows arbitrary local file reads that bypass the -allow-local-file-access (-lfa) sandbox restriction.
Affected Component
The issue is in the nuclei/mysql JavaScript library used by javascript: protocol templates. The MySQL client connection logic did not enforce the local file access sandbox when handling the allowAllFiles DSN parameter used by LOAD DATA LOCAL INFILE.
Description
Without -lfa, Nuclei confines local file access to the templates directory. However, a javascript: template could connect to a MySQL server with allowAllFiles=true in the connection DSN. With this option enabled, a malicious MySQL server can issue LOAD DATA LOCAL INFILE requests for arbitrary paths on the scanner host. The MySQL client reads the full file contents and sends them to the server, bypassing the same sandbox that blocks direct filesystem reads through other APIs.
javascript: templates execute without the -code flag and unsigned javascript: templates run by default, making this reachable from untrusted third-party templates when scanning attacker-controlled MySQL endpoints.
[!NOTE] The
-allow-local-file-access(-lfa) option is off by default. This issue allows bypassing that restriction, not merely expanding an already-enabled capability.
Affected Users
javascript: templates against MySQL-compatible targets.-lfa restriction to limit filesystem access.Patches
Mitigation
Upgrade to Nuclei v3.10.0, where the allowAllFiles DSN option is stripped unless -lfa is explicitly enabled.
In the meantime, avoid running JavaScript templates from unverified sources, especially against untrusted database endpoints.
Workarounds
If upgrading is not an option, avoid running untrusted JavaScript templates. There is no flag or configuration that mitigates this bypass on affected versions.
Acknowledgments
Thanks to @daffainfo for reporting this issue.
{
"cwe_ids": [
"CWE-284"
],
"github_reviewed": true,
"github_reviewed_at": "2026-09-22T20:37:19Z",
"nvd_published_at": "2026-09-22T17:17:24Z",
"severity": "MODERATE"
}