Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Restrict file name length for debug mode (-srd flag) to avoid system file creation errors. #5929

Open
1 task done
Lercas opened this issue Dec 19, 2024 · 1 comment · May be fixed by #5931
Open
1 task done
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@Lercas
Copy link

Lercas commented Dec 19, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

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

  1. Enable the -srd flag during a scan.
  2. Use a host or template ID with an excessively long name.
  3. 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

No error or warning logs

Environment

- OS: MacOS 15.1
- Nuclei: v3.3.7
- Go: go1.23.0 darwin/arm64

Anything else?

No response

@Lercas Lercas added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Dec 19, 2024
@Lercas
Copy link
Author

Lercas commented Dec 19, 2024

#5931

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
1 participant