Pier Angelo Vendrame pushed to branch mullvad-browser-153.0esr-16.0-1 at The Tor Project / Applications / Mullvad Browser Commits: a8a167fe by Pier Angelo Vendrame at 2026-07-22T15:28:09+02:00 fixup! BB 40925: Implemented the Security Level component BB 45131: Avoid the unsafe getBoolPref in the security level. In the security level we use getBoolPref without a default value. Therefore it might throw during the initialization of the security level. This case should not happen normally for us, but it might happen if upstream removes a preference default, and in that case the security level initialization will fail at startup. It seems better to handle the case (but add a console warning, so that we notice it and investigate it). - - - - - 1 changed file: - toolkit/components/securitylevel/SecurityLevel.sys.mjs Changes: ===================================== toolkit/components/securitylevel/SecurityLevel.sys.mjs ===================================== @@ -348,14 +348,22 @@ var read_setting_from_prefs = function (prefNames) { // For the given settingIndex, check if all current pref values // match the setting. for (const prefName of prefNames) { - const wanted = kSecuritySettings[prefName][settingIndex]; - const actual = Services.prefs.getBoolPref(prefName); - if (wanted !== actual) { - possibleSetting = false; - logger.debug( - `${prefName} does not match level ${settingIndex}: ${actual}, should be ${wanted}!` - ); - break; + try { + const wanted = kSecuritySettings[prefName][settingIndex]; + const actual = Services.prefs.getBoolPref(prefName); + if (wanted !== actual) { + possibleSetting = false; + logger.debug( + `${prefName} does not match level ${settingIndex}: ${actual}, should be ${wanted}!` + ); + break; + } + } catch (e) { + // All the relevant prefs must have a defined default. + // If we get here, a preference might have been dropped upstream, + // therefore it makes sense to ignore it to determine the security + // level, but warn so that we have a look at what went wrong. + logger.warn(`Cannot get the value for ${prefName}`, e); } } if (possibleSetting) { View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/a8a1... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/a8a1... You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
participants (1)
-
Pier Angelo Vendrame (@pierov)