5.5medium
Nuclei: Local File Read via require() Module Loader Bypass
- Severity
- 5.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.11% (higher than 1% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-29rg-wmcw-hpf4GO-2026-4965
Description
Nuclei is a vulnerability scanner built on a simple YAML-based DSL. From version 3.0.0 to before version 3.8.0, a vulnerability in Nuclei's JavaScript protocol runtime allows JavaScript templates to read local .js and .json files through the require() function, bypassing the default local file access restriction. This issue has been patched in version 3.8.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| projectdiscovery nuclei | >= 3.0.0, < 3.8.0, from 3.0.0 before 3.8.0 | CVE List, NVD |
| github.com/projectdiscovery/nuclei/v3 (Go) | from 3.0.0 before 3.8.0 | GitHub Advisory Database, Go Vulnerability Database |
| github.com/projectdiscovery/nuclei (Go) | all versions | Go Vulnerability Database |
| github.com/projectdiscovery/nuclei/v2 (Go) | all versions | Go Vulnerability Database |
All scores
| GitHub_M | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N |
| GitHub | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
Nuclei is a vulnerability scanner built on a simple YAML-based DSL. From version 3.0.0 to before version 3.8.0, a vulnerability in Nuclei's JavaScript protocol runtime allows JavaScript templates to read local .js and .json files through the require() function, bypassing the default local file access restriction. This issue has been patched in version 3.8.0.
GitHub Advisory Database
A vulnerability in Nuclei's JavaScript protocol runtime allows JavaScript templates to read local .js and .json files through the require() function, bypassing the default local file access restriction.
Affected Component
The issue is in the JavaScript runtime's module loading system. The goja require() function used a default host filesystem loader without routing through the allow-local-file-access check.
Description
The goja require() function in Nuclei's JavaScript protocol runtime used the default host filesystem loader, which allowed JavaScript templates to import .js and .json files from anywhere on the host filesystem, ignoring the allow-local-file-access (-lfa) option that controls file access outside the template directory.
The impact is limited to .js and .json files, as goja's module loader only resolves those extensions. That said, this is still enough to expose sensitive data stored in JSON configuration files like package.json, credential stores, or cloud configuration files sitting on the host filesystem.
Affected Users
- CLI users running untrusted or third-party JavaScript templates.
- SDK users who have integrated Nuclei into platforms where end-users can supply JavaScript templates, especially when relying on the default file access restriction to limit filesystem reads.
[!NOTE] The
require()module loader only resolves.jsand.jsonfiles. Other file types cannot be read through this vector.
Patches
- The vulnerability is fixed in Nuclei v3.8.0. Upgrading is strongly recommended.
- Fix reference: #7332
Mitigation
Upgrade to Nuclei v3.8.0, where the require() registry is rebuilt per execution and file-backed module loads are routed through the same allow-local-file-access check as the rest of the filesystem operations.
In the meantime, avoid running JavaScript templates from unverified sources.
Workarounds
If upgrading is not an option, avoid running untrusted JavaScript templates entirely. There is no flag or configuration that mitigates this on affected versions.
Acknowledgments
Nuceli thanks @AkashHamal0x01 for reporting this issue through responsible disclosure via security@projectdiscovery.io
Go Vulnerability Database
Nuclei: Local File Read via require() Module Loader Bypass in github.com/projectdiscovery/nuclei
NVD (es)
Nuclei es un escáner de vulnerabilidades construido sobre un DSL simple basado en YAML. Desde la versión 3.0.0 hasta antes de la versión 3.8.0, una vulnerabilidad en el tiempo de ejecución del protocolo JavaScript de Nuclei permite que las plantillas de JavaScript lean archivos .js y .json locales a través de la función require(), eludiendo la restricción predeterminada de acceso a archivos locales. Este problema ha sido parcheado en la versión 3.8.0.
References
| https://github.com/projectdiscovery/nuclei/security/advisories/GHSA-29rg-wmcw-hpf4 | advisory, mitigation, patch, vendor-advisory, web | |
| https://github.com/projectdiscovery/nuclei/pull/7332 | exploit, fix, issue-tracking, patch, web | |
| https://github.com/projectdiscovery/nuclei/commit/6f2ade6a9b427c284c15a43445f9c7f055e60e5d | fix, patch, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-41646 | advisory | |
| https://github.com/projectdiscovery/nuclei | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-41646 changed 2026-05-08 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-29rg-wmcw-hpf4 changed 2026-06-08 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-4965 changed 2026-05-20 | CC-BY-4.0 |
| NVD | CVE-2026-41646 changed 2026-10-26 | Public domain |