Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dot should not be an allowed domain name character #4282

Closed
akhmerov opened this issue Dec 24, 2022 · 3 comments · Fixed by #4471
Closed

Dot should not be an allowed domain name character #4282

akhmerov opened this issue Dec 24, 2022 · 3 comments · Fixed by #4471
Labels

Comments

@akhmerov
Copy link

Bug description

If a username contains a period and subdomains are enabled, they will get a sub-subdomain now because this code doesn't mind sub-subdomains:

# set of chars that are safe in dns labels
# (allow '.' because we don't mind multiple levels of subdomains)
_dns_safe = set(string.ascii_letters + string.digits + '-.')

I believe, however, that this doesn't match a common use case. For example, wildcard certificates don't support multilevel nesting, if I understand correctly.

Expected behaviour

Dot isn't considered a _dns_safe character.

@akhmerov akhmerov added the bug label Dec 24, 2022
@minrk
Copy link
Member

minrk commented Jan 10, 2023

Interesting! It definitely is valid sometimes, so I guess it needs to be configurable? But you're right that 'regular' wildcard SSL won't be sufficient (nested subdomains can be added via SAN, but I imagine that's pretty unusual).

@akhmerov
Copy link
Author

akhmerov commented Jan 10, 2023

Would it perhaps be a reasonable idea to consider other pathways for providing a more complex subdomain structure than accidentally via the username? Deeper nested domains are a reasonable niche application, but arbitrary level nesting based on a username seems too weird. Plus I'm not even sure if one...two.example.com is a legitimate domain name.

@minrk
Copy link
Member

minrk commented Jan 11, 2023

Would it perhaps be a reasonable idea to consider other pathways for providing a more complex subdomain structure than accidentally via the username?

I definitely think a custom hook to totally override domain-for-user makes sense.

Plus I'm not even sure if one...two.example.com is a legitimate domain name.

I'm pretty sure it's not.

There's a comment that we should really be using idna encoding for full DNS-safe labels. There's a package for that, but it doesn't handle the ASCII part of it (escape ., can't start or end with -, etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants