Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
GHSA-29rg-wmcw-hpf4
No affected components available
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
The vulnerability requires local access to the device to be exploited. It is easy for an attacker to exploit this vulnerability. An attacker does not need any special privileges or access rights. The attacker needs the user to perform some action, like clicking a link. The impact is confined to the system where the vulnerability exists. There is a high impact on the confidentiality of the information.
Exploitation attempts have been detected. Elevated vigilance and prompt remediation are advised.
The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard