Skip to content

fix: handle urllib3 LocationParseError (crash on usernames ending in .) - #3070

Open
SkxOverKill wants to merge 1 commit into
sherlock-project:masterfrom
SkxOverKill:fix/location-parse-error-crash
Open

fix: handle urllib3 LocationParseError (crash on usernames ending in .)#3070
SkxOverKill wants to merge 1 commit into
sherlock-project:masterfrom
SkxOverKill:fix/location-parse-error-crash

Conversation

@SkxOverKill

Copy link
Copy Markdown

Summary

Fixes #2970 — Sherlock crashes (unhandled urllib3.exceptions.LocationParseError) when a username produces an unresolvable URL host, e.g. alice. builds https://alice..empretienda.com.ar for Empretienda AR.

requests does not wrap urllib3 LocationParseError, so it escaped the per-site error handling in get_response() and killed the entire run via a request_future.result() exception. This converts it into a per-site "Invalid URL" error (QueryStatus.UNKNOWN) so the rest of the usernames/sites continue.

Reproduction (before)

python sherlock alice. ended with:

urllib3.exceptions.LocationParseError: Failed to parse: 'alice..empretienda.com.ar', label empty or too long

After

alice. is recorded against each site as before; the Empretienda AR site is reported as an error instead of crashing the whole search.

Changes

  • sherlock_project/sherlock.py: handle urllib3.exceptions.LocationParseError in get_response() alongside the other per-site errors.
  • pyproject.toml: declare the now-direct urllib3 dependency.
  • tests/test_probes.py: offline regression test test_location_parse_error_does_not_crash asserting the exception is surfaced as an error, not re-raised.

Verification

  • pytest -m "not online" offline suite passes (including the new regression test).
  • ruff check introduces no new violations vs. HEAD baseline.

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.

Crashes when handling usernames ending in period (.)

1 participant