CVE-2026-41646: Nuclei: Local File Read via require() Module Loader Bypass

Published Apr 22, 2026
·
Updated

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

Other sources

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.

MITRE

Affected Software

2 affected componentsFixes available
go/github.com/projectdiscovery/nuclei/v3>=3.0.0<3.8.0
3.8.0
ProjectDiscovery Nuclei Go>=3.0.0<3.8.0

Event History

Apr 22, 2026
Advisory Published
via GitHub·07:58 PM
Data Sourced
via GitHub·07:58 PM
DescriptionSeverityWeaknessAffected Software
May 8, 2026
CVE Published
via MITRE·03:14 AM
Data Sourced
via MITRE·03:14 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:16 AM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-41646?

CVE-2026-41646 is considered a high-severity vulnerability due to its potential to expose local file content to unauthorized access.

2

How do I fix CVE-2026-41646?

To remediate CVE-2026-41646, upgrade the Nuclei framework to version 3.8.0 or later.

3

What component is affected by CVE-2026-41646?

CVE-2026-41646 affects the JavaScript protocol runtime in Nuclei's module loading system.

4

What type of files can be accessed through CVE-2026-41646?

The vulnerability allows access to local `.js` and `.json` files via the `require()` function.

5

Is there a workaround for CVE-2026-41646 if I cannot update?

A temporary workaround for CVE-2026-41646 is to disable the JavaScript execution feature if it's not necessary for your use case.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203