GHSA-qgw5-7j4f-fg97: Medium severity go/github.com/projectdiscovery/nuclei/v3 vulnerability
A vulnerability in Nuclei's workflow template loader allows file: protocol templates to execute without the -file flag, bypassing a security gate that is meant to prevent local file reads on the scanner host.
Affected Component
The issue is in the workflow template loading path. The main template loader enforces the -file gate for file-protocol templates, but the workflow loader did not apply the same check when resolving templates referenced by a workflow.
Description
Nuclei disables file-protocol templates by default because they read local files from the host running the scanner. Operators must explicitly enable them with the -file flag. When a workflow references a file-protocol template, the workflow loader accepted and executed that template without verifying that -file was enabled.
Because workflows run unsigned by default, an untrusted workflow could load and execute a file-protocol template and read local files from the scan target path, even though the operator had not enabled file templates.
[!NOTE] File-protocol templates are disabled by default. This issue only affects users who run workflows from untrusted sources without having explicitly enabled -file.
Affected Users
- CLI users running workflows (-w) that reference file-protocol templates from untrusted or third-party sources. - SDK users who integrate Nuclei into platforms where end users can supply workflow files and rely on the default -file restriction to block local file access.
Patches
- The vulnerability is fixed in Nuclei v3.10.0. Upgrading is strongly recommended. - Fix reference: https://github.com/projectdiscovery/nuclei/pull/7489
Mitigation
Upgrade to Nuclei v3.10.0, where template execution requirements (including the -file gate) are enforced consistently across the main loader, workflow parsing, and request compilation paths.
In the meantime, avoid running workflows from unverified sources.
Workarounds
If upgrading is not an option, do not run untrusted workflow files. There is no configuration flag that mitigates this bypass on affected versions.
Acknowledgments
Thanks to @daffainfo for reporting this issue.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
go/github.com/projectdiscovery/nuclei/v3to a version that resolves this vulnerability.Fixed in 3.10.0 - Upgrade
Upgrade
Nucleito a version that resolves this vulnerability.Fixed in v3.10.0 - Compensating control
Do not run untrusted or unverified workflow files if upgrading is not possible.
Event History
Frequently Asked Questions
Who is exposed to this issue?
Operators who run Nuclei workflows obtained from untrusted sources are affected. File-protocol templates are disabled by default, so users who do not run untrusted workflows are not affected by this bypass.
What does an attacker need to exploit the vulnerability?
An attacker needs to persuade an operator to run an untrusted workflow that references a file-protocol template. No special Nuclei flag is required because the workflow loading path bypasses the normal -file gate.
What can be exposed if exploitation succeeds?
The referenced file-protocol template can read local files from the host running the scanner, including files reachable through the scan target path. The provided vector indicates confidentiality impact without integrity or availability impact.
What should operators do if they cannot apply a fix immediately?
Do not run workflows from untrusted sources. Treat unsigned workflows as untrusted unless their source and referenced templates have been reviewed.