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

Hide http user agent for DNS over HTTPS like what Firefox and iOS do? #446

Closed
PeterDaveHello opened this issue Feb 28, 2022 · 5 comments · Fixed by #518
Closed

Hide http user agent for DNS over HTTPS like what Firefox and iOS do? #446

PeterDaveHello opened this issue Feb 28, 2022 · 5 comments · Fixed by #518
Labels
🔨 enhancement New feature or request
Milestone

Comments

@PeterDaveHello
Copy link
Contributor

Just found that currently blocky is using the default HTTP user agent string: Go-http-client/1.1, though we know that there're tons of user profiling mechanisms to find out the tools and details about the users, but maybe it'll be great if we can give one less information, like user agent string? That's what Firefox and iOS doing, both known as privacy protected products, is this something blocky would like to do 😃

@0xERR0R
Copy link
Owner

0xERR0R commented Feb 28, 2022

Hi, so you would suggest to remove the user agent parameter from the header? Or to use some fake/specific value?

@PeterDaveHello
Copy link
Contributor Author

Hi @0xERR0R, maybe simply removing it will be good enough for me ;)

Fake it may not be too helpful when somebody trying to do some deep analysis about the behavior, the same thing on removing the user-agent header, but at least those https reverse proxies (in front of the DoH servers, some may be CDNs) will have one less thing to know about the users. That may be the reason why Apple and Mozilla is doing it.

Just FYR, m13253/dns-over-https has an option to empty the user-agent, though they don't recommend it, maybe you'll also be interested in their opinion:

It is generally not recommended to disable submitting User-Agent because it
is still possible to probe client version according to behavior differences,
such as TLS handshaking, handling of malformed packets, and specific bugs.
Additionally, User-Agent is an important way for the server to distinguish
buggy, old, or insecure clients, and to workaround specific bugs.
(e.g. doh-server can detect and workaround certain issues of DNSCrypt-Proxy
and older Firefox.)
(copied from doh-client/doh-client.conf in the repo)

@engineeringsys
Copy link

Could this be parameterized in the config.yml to consume a user-crafted user-agent string? Alternatively you could likely create a struct with multiple types and have it randomly iterate as the resolver queries the upstream services. I'd rather fake an agent string vs keeping the default signature the golang http-client sends.

Currently blocky sends out a constant signature which as @PeterDaveHello mentioned could be profiled easily

@0xERR0R
Copy link
Owner

0xERR0R commented Feb 28, 2022

ok, so we can provide a configuration property to set the user agent string in the config.yaml (default empty, which means so user agent string will be sent).

@0xERR0R 0xERR0R added the 🔨 enhancement New feature or request label Feb 28, 2022
@0xERR0R 0xERR0R added this to the 0.19 milestone Feb 28, 2022
PeterDaveHello added a commit to PeterDaveHello/blocky that referenced this issue May 13, 2022
@PeterDaveHello
Copy link
Contributor Author

@0xERR0R I tried to make a patch here: #518, would you like to help take a look? Thanks.

PeterDaveHello added a commit to PeterDaveHello/blocky that referenced this issue May 14, 2022
PeterDaveHello added a commit to PeterDaveHello/blocky that referenced this issue May 14, 2022
PeterDaveHello added a commit to PeterDaveHello/blocky that referenced this issue May 14, 2022
@0xERR0R 0xERR0R linked a pull request May 16, 2022 that will close this issue
FileGo pushed a commit to FileGo/blocky that referenced this issue May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants