Closed Bug 1559747 Opened 5 months ago Closed 5 months ago

User-Agent string needn't reveal a user is running 32-bit Firefox on a 64-bit OS

Categories

(Core :: Networking: HTTP, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox-esr60 --- wontfix
firefox67 --- wontfix
firefox67.0.1 --- wontfix
firefox68 --- wontfix
firefox69 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, site-compat, Whiteboard: [necko-triaged])

Attachments

(2 files)

These patches change the User-Agent HTTP header and the navigator.userAgent, navigator.platform, and navigator.oscpu APIs to say Linux x86_64 instead Linux i686 on x86_64 (bug 265536) and Win64 instead of WOW64 (bug 444770) when the user is running a 32-bit Firefox on a 64-bit OS. Software download websites that try to sniff for the user's CPU architecture (so they can serve compatible software) only need to know whether the user has a 32- or 64-bit OS, not whether they are running a 32- or 64-bit Firefox build.

I'm rewriting my more extensive CPU architecture/User-Agent string patches in bug 1556223, but in the meantime, the User-Agent string patches here are self-contained and don't need to be behind a pref. They are very low risk for any possible webcompat issues.

Once upon a time, Mozilla's Plugin Finder Service needed to check whether Firefox was 32- or 64-bit so it could direct the user to a Flash Player plugin compatible with their Firefox build (bug 265536). But these days Adobe's Flash Player installer includes both 32- and 64-bit plugins.

Change the User-Agent HTTP header and the navigator.userAgent, navigator.platform, and navigator.oscpu APIs to say "Linux x86_64" instead "Linux i686 on x86_64" (bug 265536) when the user is running 32-bit Firefox on a 64-bit Unix OS (including Android). Software download websites that try to sniff for the user's CPU architecture (so they can serve compatible software) only need to know whether the user has a 32- or 64-bit OS, not whether they are running a 32- or 64-bit Firefox build.

Once upon a time, Mozilla's Plugin Finder Service needed to check whether Firefox was 32- or 64-bit so it could direct the user to a Flash Player plugin compatible with their Firefox build (bug 265536). But these days Adobe's Flash Player installer includes both 32- and 64-bit plugins.

Change the User-Agent HTTP header and the navigator.userAgent, navigator.platform, and navigator.oscpu APIs to say "Win64" instead "WOW64" (bug 444770) when the user is running 32-bit Firefox on Win64 OS. Software download websites that try to sniff for the user's CPU architecture (so they can serve compatible software) only need to know whether the user has a 32- or 64-bit OS, not whether they are running a 32- or 64-bit Firefox build.

Once upon a time, Mozilla's Plugin Finder Service needed to check whether Firefox was 32- or 64-bit so it could direct the user to a Flash Player plugin compatible with their Firefox build (bug 265536). But these days Adobe's Flash Player installer includes both 32- and 64-bit plugins.

Depends on D35164

Whiteboard: [necko-triaged]
Keywords: dev-doc-needed
Pushed by cpeterson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dcd234c04764
Part 1: UA string needn't reveal the user is running 32-bit Firefox on a 64-bit Unix OS. r=tjr
https://hg.mozilla.org/integration/autoland/rev/ef0e2b842932
Part 2: UA string needn't reveal the user is running 32-bit Firefox on Win64 OS. r=tjr
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Keywords: site-compat

Hi,

I would really appreciate it if you guys can also update these
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox
https://support.mozilla.org/en-US/kb/how-do-i-tell-if-32-bit-or-64-bit
so they include the changes that have been implemented here.

For my own project https://github.com/nielsbasjes/yauaa it would be really nice if you can provide a few 'full' examples of what the new useragents look like (putting them on one of these two pages seems to me the best place to put them).

Thanks.

Niels Basjes

(In reply to Niels Basjes from comment #5)

I would really appreciate it if you guys can also update these
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox
https://support.mozilla.org/en-US/kb/how-do-i-tell-if-32-bit-or-64-bit

Note that at least MDN is a Wiki.
If you feel comfortable to do it, just sign in with a Github account and edit yourself.
That said, the "dev-doc-needed" keyword is set in this bug and should attract folks to make the changes.

Thanks for Contribution!

(In reply to Niels Basjes from comment #5)

I would really appreciate it if you guys can also update these
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox
https://support.mozilla.org/en-US/kb/how-do-i-tell-if-32-bit-or-64-bit
so they include the changes that have been implemented here.

Thanks for the suggestion. That's a good idea. I updated the User-Agent MDN article. (I just removed the "WOW64" and Linux "i686 on x86_64" examples.

I didn't edit the how-do-i-tell-if-32-bit-or-64-bit SUMO article because it doesn't talk about the User-Agent string. The article's instructions for checking the "About Firefox" window are still correct. (32-bit) or (64-bit) will be shown under the Firefox name, after the version number.

For my own project https://github.com/nielsbasjes/yauaa it would be really nice if you can provide a few 'full' examples of what the new useragents look like (putting them on one of these two pages seems to me the best place to put them).

The User-Agent MDN article has some examples like:

Windows NT on x86 CPU Mozilla/5.0 (Windows NT x.y; rv:10.0) Gecko/20100101 Firefox/10.0
Windows NT on x64 CPU Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0) Gecko/20100101 Firefox/10.0

Are you looking for more specific examples? I'm running Firefox 69 Nightly on Win64 OS and my User-Agent string is Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0. I'm running a 64-bit Firefox build, but my User-Agent string would be the same if I was running a 32-bit Firefox build because my OS would still be Win64.

Thanks!
I've implemented these examples at my end as new testcases and I've also included your useragent example in there.

I mentioned the how-do-i-tell-if-32-bit-or-64-bit SUMO article because it includes the "WOW64" in one of the tables.
To me this is fine this way.

I've added a note to the Firefox user agent string reference article on MDN that notes this change.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox#General_form

Updated a few other pages slightly. More details soon.

You need to log in before you can comment on or make changes to this bug.