Skip to content

Custom domain: don't allow external domain #11064

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

Merged
merged 2 commits into from
Jan 25, 2024
Merged

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Jan 24, 2024

We have a CNAME from our external domain to readthedocs.io, making these domains valid if they are added to a project.

This isn't a security issue, since our code won't resolve those domains because custom domains are checked last, and we have this protection in place:

if public_domain in domain or external_domain in domain:
# NOTE: This can catch some possibly valid domains (docs.readthedocs.io.com)
# for example, but these might be phishing, so let's block them for now.
log.debug("Weird variation of our domain.", domain=domain)
raise SuspiciousHostnameError(domain=domain)

We have a CNAME from our external domain to readthedocs.io,
making these domains valid if they are added to a project.

This isn't a security issue, since our code won't resolve
those domains because custom domains are checked last,
and we have this protection in place:

https://github.com/readthedocs/readthedocs.org/blob/7daff3d6cc953898934cc80cba53403d6e0fa259/readthedocs/core/unresolver.py#L590-L594
@stsewd stsewd requested a review from a team as a code owner January 24, 2024 22:04
@stsewd stsewd requested a review from humitos January 24, 2024 22:04
@stsewd stsewd merged commit f72581c into main Jan 25, 2024
@stsewd stsewd deleted the disallow-external-domains branch January 25, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants