Skip to content

Harden username URL handling and worker pool sizing in Sherlock core#2849

Open
Chintanpatel24 wants to merge 3 commits intosherlock-project:masterfrom
Chintanpatel24:patch-1
Open

Harden username URL handling and worker pool sizing in Sherlock core#2849
Chintanpatel24 wants to merge 3 commits intosherlock-project:masterfrom
Chintanpatel24:patch-1

Conversation

@Chintanpatel24
Copy link
Copy Markdown

This PR improves security and runtime robustness in the main Sherlock scanning engine.

Changes :

  • Added a dedicated username URL-encoding step using strict percent-encoding before interpolating into target URLs.
  • Replaced the previous worker count logic with a bounded-safe expression:
  • minimum 1 worker
  • maximum 20 workers

Why this helps :

  • Security: prevents crafted usernames with reserved URL characters from altering request path/query semantics.
  • Reliability: avoids invalid zero-worker initialization when site data is empty.
  • Efficiency: keeps concurrency bounded while avoiding edge-case failures.

Copilot AI review requested due to automatic review settings March 30, 2026 11:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to harden Sherlock’s core scanning loop by (a) percent-encoding usernames before interpolating them into target URLs and (b) clamping the worker pool size to a safe range to avoid zero-worker initialization.

Changes:

  • Introduces url_safe_username() and uses it when interpolating url / urlProbe.
  • Replaces worker count logic with min(20, max(1, len(site_data))).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Chintanpatel24 and others added 2 commits March 30, 2026 16:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants