Is there an existing issue for this?
Current Behavior
When the -srd flag is enabled, the WriteStoreDebugData function generates file names based on the host and template ID. If these components are too verbose, the resulting file name can exceed the operating system's maximum file name length. This causes the debug files to fail to be created, resulting in a broken debug logging experience.
Expected Behavior
File names should be truncated to a maximum length that adheres to operating system limitations, ensuring that debug files are always created successfully regardless of the length of the host or template ID.
Steps To Reproduce
- Enable the
-srd flag during a scan.
- Use a host or template ID with an excessively long name.
- Observe that debug files are not created and an error is logged.
nuclei -t ./templates/ -list ./result/katana_result.txt -dast -dfp -im list -je ./result/nucleiGetFuzz.json -srd ./result/debug_nuclei -nc -stats -headless -fa high -debug
katana_result:
...
https://api.test.com/method/test/test.getConfig?access_token=03NNuOkyDuwHXDvL8T4Pv048AYq3Hok6oCxWWn7MZRoVEk6-pJYSHhm65omhCDrxy6KbCE9obJhbihbGH36JK732kThhH72HiuepqmnKz3bkjMQnZJerVAr0iMqNhon-05lnWAijMzsfD4tmHLFyVREmdxTe-OrrPh8E6xfuCrp9P3BbY-VbvnvTILfFoKLd7OnbIE4ucCuD1pkh7VtJ8WGjBcVJIWPXCr59nte6IQ6YBkob8w&fields=1&ids=3&owner_id=1&version=1&with_hidden=true
...
Relevant log output
Environment
- OS: MacOS 15.1
- Nuclei: v3.3.7
- Go: go1.23.0 darwin/arm64
Anything else?
No response
Is there an existing issue for this?
Current Behavior
When the
-srdflag is enabled, theWriteStoreDebugDatafunction generates file names based on the host and template ID. If these components are too verbose, the resulting file name can exceed the operating system's maximum file name length. This causes the debug files to fail to be created, resulting in a broken debug logging experience.Expected Behavior
File names should be truncated to a maximum length that adheres to operating system limitations, ensuring that debug files are always created successfully regardless of the length of the host or template ID.
Steps To Reproduce
-srdflag during a scan.nuclei -t ./templates/ -list ./result/katana_result.txt -dast -dfp -im list -je ./result/nucleiGetFuzz.json -srd ./result/debug_nuclei -nc -stats -headless -fa high -debug
katana_result:
Relevant log output
Environment
Anything else?
No response