# CVE-2023-37896: Nuclei Path Traversal vulnerability

> Attackers using the Nuclei Go SDK with custom templates can read arbitrary files due to improper path sanitization in sandbox mode.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 4 Aug 2023
- **Updated:** 8 Oct 2024
- **Also known as:** GHSA-2xx4-jj5v-6mff, GO-2023-1998

## What is CVE-2023-37896?

CVE-2023-37896 is a high-severity path traversal vulnerability in projectdiscovery nuclei, published on 4 Aug 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Nuclei is a vulnerability scanner. Prior to version 2.9.9, a security issue in the Nuclei project affected users utilizing Nuclei as Go code (SDK) running custom templates. This issue did not affect CLI users. The problem was related to sanitization issues with payload loading in sandbox mode. There was a potential risk with payloads loading in sandbox mode. The issue occurred due to relative paths not being converted to absolute paths before doing the check for `sandbox` flag allowing arbitrary files to be read on the filesystem in certain cases when using Nuclei from `Go` SDK implementation. 

This issue has been fixed in version 2.9.9. The maintainers have also enabled sandbox by default for filesystem loading. This can be optionally disabled if required. The `-sandbox` option has been deprecated and is now divided into two new options: `-lfa` (allow local file access) which is enabled by default and `-lna` (restrict local network access) which can be enabled by users optionally. The `-lfa` allows file (payload) access anywhere on the system (disabling sandbox effectively), and `-lna` blocks connections to the local/private network.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2023-37896?

5 open source packages ship an affected version, including github.com/projectdiscovery/nuclei/v2 and github.com/projectdiscovery/nuclei. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/projectdiscovery/nuclei/v2` | Go | All versions | 2.9.9 |
| `github.com/projectdiscovery/nuclei/v2` | Go | All versions | 2.9.9 |
| `github.com/projectdiscovery/nuclei/v2` | Go | All versions | 2.9.9 |
| `github.com/projectdiscovery/nuclei` | Go | All versions | 2.9.9 |
| `github.com/projectdiscovery/nuclei` | Go | All versions | 2.9.9 |

Products: Projectdiscovery Nuclei.

## How do I fix CVE-2023-37896?

Upgrade github.com/projectdiscovery/nuclei/v2 to 2.9.9 or later.

## Is CVE-2023-37896 being exploited?

There is no known exploitation of CVE-2023-37896 in the wild and no public exploit code.

## Other vulnerabilities in projectdiscovery nuclei

- [CVE-2024-43405](https://insights.sbomify.com/CVE-2024-43405/): Nuclei Template Signature Verification Bypass (high 7.4)
- [CVE-2024-27920](https://insights.sbomify.com/CVE-2024-27920/): Unsigned code template execution through workflows in projectdiscovery/nuclei (high 7.4)
- [CVE-2026-41646](https://insights.sbomify.com/CVE-2026-41646/): Nuclei: Local File Read via require() Module Loader Bypass (medium 5.5)
- [CVE-2026-41645](https://insights.sbomify.com/CVE-2026-41645/): Nuclei: Environment variable disclosure via Response-Derived DSL Expressions (medium 5.3)
- [CVE-2026-41282](https://insights.sbomify.com/CVE-2026-41282/): Code injection in Nuclei (medium 4.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-37896 and fix it if it is affected.

What it is: CVE-2023-37896 is a high-severity path traversal vulnerability in projectdiscovery nuclei, published on 4 Aug 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-37896 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/projectdiscovery/nuclei/v2 (Go): affected all versions; fixed in 2.9.9
- github.com/projectdiscovery/nuclei/v2 (Go): affected all versions; fixed in 2.9.9
- github.com/projectdiscovery/nuclei/v2 (Go): affected all versions; fixed in 2.9.9
- github.com/projectdiscovery/nuclei (Go): affected all versions; fixed in 2.9.9
- github.com/projectdiscovery/nuclei (Go): affected all versions; fixed in 2.9.9

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-37896/ (Markdown: https://insights.sbomify.com/CVE-2023-37896/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-37896
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-37896
- OSV: https://osv.dev/vulnerability/CVE-2023-37896

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-37896/
Summaries are generated and may contain mistakes; the official description above is the record.
