Opened 14 months ago

Closed 11 months ago

Last modified 10 months ago

#24159 closed defect (fixed)

The Torbutton version check does not deal properly with platform specific checks

Reported by: gk Owned by: tbb-team
Priority: High Milestone:
Component: Applications/Tor Browser Version:
Severity: Major Keywords: tbb-torbutton, TorBrowserTeam201801R, tbb-backported
Cc: boklm, brade, mcs Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Torbutton checks on first start (and then periodically) whether the currently deployed version is still up-to-date and, if not, shows a big warning and an error pointing to the onion menu (allowing the user to update manually).

In order to do so it requests: https://www.torproject.org/projects/torbrowser/RecommendedTBBVersions which delivers back something like:

[
"7.0.6",
"7.0.6-Windows",
"7.0.7",
"7.0.7-Windows",
"7.0.8",
"7.0.8-Windows",
"7.0.9",
"7.0.9-MacOS",
"7.0.9-Linux",
"7.5a5",
"7.5a5-Windows",
"7.5a6",
"7.5a6-Windows",
"7.5a7",
"7.5a7-MacOS",
"7.5a7-Linux"
]

The idea with the platform specifiers included was to allow users to stay on different versions depending on which platform they are. This is quite handy in cases like the recent one where we needed to provide updates to Linux and macOS users but Windows users were not affected. The example response above is meant for such a scenario: a Tor Browser < 7.0.9 is not recommended anymore for Linux or macOS while Windows users, which stay on 7.0.8, are perfectly fine provided they have at least version 7.0.6.

Now, that does not work as the code in question just checks torbrowser.version which does not contain platform information (anymore):

          try {
            var version_list = JSON.parse(req.responseText);
            var my_version = m_tb_prefs.getCharPref("torbrowser.version");
            for (var v in version_list) {
              if (version_list[v] == my_version) {
                torbutton_log(3, "Version check passed.");
                m_tb_prefs.setBoolPref(k_tb_browser_update_needed_pref, false);
                return;
              }
            }
            torbutton_log(5, "Your Tor Browser is out of date.");
            m_tb_prefs.setBoolPref(k_tb_browser_update_needed_pref, true);
            return;
          } catch(e) {
            torbutton_log(5, "Version check failed! JSON parsing error: "+e);
            return;
          }

One way to fix that is just adding "-$PLATFORM" to my_version (assuming the platform notation we get with some XPCOM API is the same we have in our recommended versions file).

Child Tickets

Change History (9)

comment:1 Changed 14 months ago by mcs

We could use Services.appinfo.OS, but it returns strings like Darwin and WINNT.

comment:2 in reply to:  1 Changed 14 months ago by gk

Replying to mcs:

We could use Services.appinfo.OS, but it returns strings like Darwin and WINNT.

Well, we could easily translate that into "MacOS" and "Windows". I think we should make only client side changes, i.e. in Torbutton. For one this makes the fix less complex. And secondly, there might be third parties relying on the recommended versions file as it is right now.

comment:3 Changed 13 months ago by gk

Moving tickets to December 2017

comment:4 Changed 13 months ago by gk

Keywords: TorBrowserTeam201712 added; TorBrowserTeam201711 removed

Moving tickets to December 2017, for realz.

comment:5 Changed 11 months ago by gk

Keywords: TorBrowserTeam201801 added; TorBrowserTeam201712 removed

Moving tickets to 2018.

comment:6 Changed 11 months ago by mcs

Cc: brade mcs added
Keywords: TorBrowserTeam201801R added; TorBrowserTeam201801 removed
Status: newneeds_review

comment:7 Changed 11 months ago by gk

Keywords: tbb-backport added
Resolution: fixed
Status: needs_reviewclosed

Looks good to me. Merged to master with commit f8604998e58fdece9c191661121ada6a3b911499 and marking for this ticket for a possible backport.

comment:8 in reply to:  7 Changed 10 months ago by gk

Replying to gk:

Looks good to me. Merged to master with commit f8604998e58fdece9c191661121ada6a3b911499 and marking for this ticket for a possible backport.

This is commit f8604998e58fdece9c191661121ada6a3b911499 on maint-1.9.8 as well and will be available in 7.5.1.

comment:9 Changed 10 months ago by gk

Keywords: tbb-backported added; tbb-backport removed
Note: See TracTickets for help on using tickets.