Skip to content

Conversation

Mehran-Seifalinia
Copy link

Summary

This pull request addresses a critical crash issue in the dialParallel method of the DialWrap struct, caused by a missing nil receiver check and an incorrect variable reference inside the internal startRacer function.

Changes

  • Added nil check for the DialWrap receiver (d) to prevent runtime panics when it is nil.
  • Added nil check for the internal dialer field to ensure safe dialing operations.
  • Fixed a variable misuse in startRacer function: replaced undefined ras with targets.
  • Maintained existing logic for dialing primary and fallback IP lists with improved safety.

Impact

These changes improve the stability and robustness of the dialing mechanism used by fastdialer, preventing crashes reported in issue #5934 when running nuclei against large lists of websites.

Testing

The fix was tested locally by simulating nil receiver conditions and dialing with various IP sets, confirming no crashes and proper fallback behavior.


Closes #5934

This resolves issue #5934 reported in the nuclei repository.

This commit fixes a critical crash in the dialParallel method of DialWrap where the receiver
could be nil, causing a runtime panic. Added explicit nil checks for both the DialWrap receiver
and its internal dialer before proceeding with dialing operations.

Also corrected a variable misuse inside startRacer from 'ras' to 'targets' to avoid undefined
identifier errors. These changes improve the stability and reliability of connection dialing
in fastdialer, preventing unexpected crashes when dialing with primary and fallback IP lists.
The undefined: fmt error was caused by the missing import of the "fmt" package.
@ehsandeep ehsandeep requested a review from tarunKoyalwar July 26, 2025 08:55
Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the pr @Mehran-Seifalinia , but the issue linked seems to be different , we are adding a nil check for case when the method receiver is nil which shouldn't be the case, most likely the global fastdialer used in httpclientpool is being closed or is nil , that seems to be the root cause

this will hide the panic but won't fix the issue and it will cause on a different method call of dialer

cc: @dwisiswant0 , seems like we have a case where global fastdialer instance is being closed early

@Mzack9999
Copy link
Member

@Mehran-Seifalinia I'm closing the PR as introducing the changes would break current functionalities. We will keep an eye on the issue and will try to nail down a fix within nuclei. Thanks for your contribution!

@Mzack9999 Mzack9999 closed this Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] ... Crash while running on list of websites
3 participants