Skip to content

Nuclei: Local File Read via require() Module Loader Bypass

Moderate severity GitHub Reviewed Published Apr 18, 2026 in projectdiscovery/nuclei

Package

gomod github.com/projectdiscovery/nuclei/v3 (Go)

Affected versions

>= 3.0.0, < 3.8.0

Patched versions

3.8.0

Description

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 .js and .json files. 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

References

@ehsandeep ehsandeep published to projectdiscovery/nuclei Apr 18, 2026
Published to the GitHub Advisory Database Apr 22, 2026
Reviewed Apr 22, 2026

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N

EPSS score

Weaknesses

Improper Access Control

The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. Learn more on MITRE.

CVE ID

CVE-2026-41646

GHSA ID

GHSA-29rg-wmcw-hpf4

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.