Skip to content

reject usernames that contain dots at the Empretienda AR probe#3015

Open
HrachShah wants to merge 1 commit into
sherlock-project:masterfrom
HrachShah:fix/empretienda-regexcheck
Open

reject usernames that contain dots at the Empretienda AR probe#3015
HrachShah wants to merge 1 commit into
sherlock-project:masterfrom
HrachShah:fix/empretienda-regexcheck

Conversation

@HrachShah

Copy link
Copy Markdown

Closes #2970.

The url pattern for Empretienda AR embeds the username as a subdomain of empretienda.com.ar (https://{}.empretienda.com.ar). A username that contains a period, e.g. alice., is interpolated into the host of the request, producing a URL like

https://alice..empretienda.com.ar

The intermediate double dot is not a valid DNS label separator, so urllib3 raises LocationParseError from the adapter and the whole sherlock run aborts with a traceback pointing at create_connection instead of skipping the broken site.

Fix: add a regexCheck that matches the same character class as the other subdomain-style entries already in the manifest (booth.pm, blogspot.com, carbonmade.com, crevado.com, exposure.co, etc.), namely ^[\\w@-]+?$. That accepts the usernames Empretienda actually issues (letters, digits, underscores, hyphens, at-signs) and rejects any with dots or other characters that would corrupt the host part of the interpolated URL. The skip path is QueryStatus.ILLEGAL, the same as the other sites that use this regex, and the run continues past the problematic username.

Verified locally that test_validate_manifest_against_local_schema still passes; the rest of the regex behaviour can be exercised against any of the existing test_username_illegal_regex-style probes.

The url pattern for Empretienda AR embeds the username as a subdomain
of empretienda.com.ar ("https://{}.empretienda.com.ar"). A username
that contains a period, e.g. "alice.", is interpolated into the host
of the request, producing a URL like

    https://alice..empretienda.com.ar

The intermediate double dot is not a valid DNS label separator, so
urllib3 raises LocationParseError from the adapter and the whole
sherlock run aborts with a traceback pointing at create_connection
instead of skipping the broken site.

Add a regexCheck that matches the same character class as the other
subdomain-style entries already in the manifest (booth.pm, blogspot.com,
carbonmade.com, crevado.com, exposure.co, etc.), namely ^[\w@-]+?$.
That accepts the usernames Empretienda actually issues (letters,
digits, underscores, hyphens, at-signs) and rejects any with dots or
other characters that would corrupt the host part of the interpolated
URL. The skip path is QueryStatus.ILLEGAL, the same as the other
sites that use this regex, and the run continues past the
problematic username.
rizwanshabinabdullah-dev

This comment was marked as spam.

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 (.)

2 participants