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

Consider tracking preferred protocol for onion addresses #832

Closed
eloquence opened this issue Apr 6, 2021 · 2 comments · Fixed by #878
Closed

Consider tracking preferred protocol for onion addresses #832

eloquence opened this issue Apr 6, 2021 · 2 comments · Fixed by #878

Comments

@eloquence
Copy link
Member

Currently we do not track whether a SecureDrop uses HTTP or HTTPS. Given that onion services have their own encryption layer, this is generally not a security concern, but see https://community.torproject.org/onion-services/advanced/https/ for the pros and cons of running onion services over HTTPS.

We could potentially set the protocol in cases where a SecureDrop is served over HTTPS. This would also allow the automated script that populates the onion name ruleset to use this protocol, instead of always using HTTP.

This appears to be mostly a content issue as the current validator only checks for the .onion suffix and will happily accept any protocol:

onion_address = models.CharField(
'SecureDrop onion address',
max_length=255,
validators=[RegexValidator(regex=r'\.onion$', message="Enter a valid .onion address.")]
)

The API, too, will return results with or without protocol, and the directory entries will show the protocol if it is included.

Advantages of tracking the protocol:

  • We avoid an HTTP->HTTPS redirect when using an onion name or copy/pasting the address, which could mitigate against downgrade attacks by a very sophisticated attacker.

Disadvantages:

  • If a news org switches to HTTPS and then stops using it, onion names will break (bug or feature?)
@eloquence
Copy link
Member Author

There's some external interest in this as well, so bumping priority.

@eloquence
Copy link
Member Author

We discussed this a bit today and agreed it'd be nice to have an "HTTPS preferred" property for onion services. That way, we can prefix the protocol where warranted, and also return that property in the API.

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

Successfully merging a pull request may close this issue.

2 participants