You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the validators library in a URL scanning project. But this URL that work in the browser doesn't get recognized as a URL (replaced the tt by xx because it's a malicious sample):
I'm not sure about the standard and how more I read how more confused I get, but the thing is:
Most browsers are accepting urls with subdomains like _wildcard_.jetsett.in and malicious actors are using them in phishing campaigns etc.
At the moment it poses a real threat, because a lot of (antivirus) companies use validators for urls just like this one.
The urls never get in their blocklists, exposing their users to more risk because these malicious urls work fine in their browsers.
I don't know if this is something that should be fixed in the browsers, in the standard or in the validators, and the issue is definitely bigger than just this implementation.
So to be clear:
We are figuring out if http://_wildcard_.domain.com is a valid url.
We agree that http://_wildcard.jetsett.in and https://my_sarisari_store.typepad.com/ are valid urls.
So an underscore can be used in any place of the subdomain except the one right before the dot?
Some more information: It seems like SSL certificates cannot be generated for _wildcard_.domain.com but a wildcard certificate like *.domain.com works just fine for _wildcard_.domain.com
Activity
nandgator commentedon Nov 2, 2023
I do not understand, it works as expected.
hxxp/hxxpsis a convention, not a valid protocol.jeroengui commentedon Nov 2, 2023
I get that hxxp/hxxps is just a convention. I only wanted to raise an issue about the http version.
The Markdown syntax in this issue removed the underscores from the url with
_wildcard_, sorry for that.When I run this I get this output:
nandgator commentedon Nov 6, 2023
nandgator commentedon Mar 19, 2024
Hey @jeroengui the domain
_wildcard_.jetsett.inseems to be invalid.Because the following is valid according to
rfc_2782(TLDR: underscores are prepended not appended).Are you sure it's not
_wildcard._jetsett.ininstead?jeroengui commentedon Mar 19, 2024
I'm not sure about the standard and how more I read how more confused I get, but the thing is:
Most browsers are accepting urls with subdomains like
_wildcard_.jetsett.inand malicious actors are using them in phishing campaigns etc.At the moment it poses a real threat, because a lot of (antivirus) companies use validators for urls just like this one.
The urls never get in their blocklists, exposing their users to more risk because these malicious urls work fine in their browsers.
I don't know if this is something that should be fixed in the browsers, in the standard or in the validators, and the issue is definitely bigger than just this implementation.
So to be clear:
We are figuring out if
http://_wildcard_.domain.comis a valid url.We agree that
http://_wildcard.jetsett.inandhttps://my_sarisari_store.typepad.com/are valid urls.So an underscore can be used in any place of the subdomain except the one right before the dot?
Stackoverflow has had some discussion on the topic also: https://stackoverflow.com/questions/2180465/can-domain-name-subdomains-have-an-underscore-in-it
EDIT: I added an example DNS record on my own domain that seems to work fine in most browsers : here (
https://_test_.jeroengui.be/)jeroengui commentedon Mar 19, 2024
Some more information: It seems like SSL certificates cannot be generated for
_wildcard_.domain.combut a wildcard certificate like*.domain.comworks just fine for_wildcard_.domain.comhttps://cabforum.org/2018/11/12/ballot-sc12-sunset-of-underscores-in-dnsnames/
nandgator commentedon Mar 20, 2024
rfc_1034does not mention anything about underscore.rfc_2782talks about prepending underscores.This patch
in
validators/src/validators/domain.py
Line 45 in 854375f
will work.
You'll have to add
("example_.com", False, True)to pytest parameter list oftest_returns_true_on_valid_domain()intest_domain.py.PR is welcome.