Skip to content

Conversation

gaurav4288
Copy link

🧠 Pull Request Description

Summary
This PR fixes a false positive for the Topcoder site reported in Issue #2669.
Previously, Sherlock incorrectly detected existing accounts for usernames that did not exist.


Changes Made

  • Updated the Topcoder username regex pattern in sherlock/resources/data.json.

  • Replaced the old pattern:
    [a-zA-Z0-9 ]

  • with the corrected one:
    ^[A-Za-z0-9 _-]{1,50}$

  • This ensures proper validation of Topcoder usernames (letters, numbers, underscores, and hyphens within 1–50 characters).


Verification

  • ✅ Tested Sherlock with multiple valid and invalid usernames.
  • ✅ Valid usernames are detected correctly.
  • ✅ Invalid usernames (containing spaces or disallowed characters) are rejected.
  • ✅ Eliminated the false positives previously reported.

Related Issue
Closes #2669


Testing Example

python -m sherlock_project john0011 --site Topcoder
python -m sherlock_project --local john0011

Copy link
Contributor

Automatic validation of changes

Target F+ Check F- Check
Topcoder ✔️   Pass ✔️   Pass

@ppfeister
Copy link
Member

Did you confirm that the maximum username length is actually 50 chars? If so, that'll be a stronger pattern to use than a wildcard quantifier.

@gaurav4288
Copy link
Author

yes
Screenshot 2025-10-19 at 14-35-49 Sign In with Topcoder

@ppfeister
Copy link
Member

Looks like 2-15 rather than 1-50? Are there legacy accounts with the larger range, maybe?

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.

False positive for: Topcoder

2 participants