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 Firefox < 128 and != 115 as incompatible due to root CA expiration #13502

Merged
merged 4 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/amo/components/InstallButtonWrapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
INCOMPATIBLE_ANDROID_UNSUPPORTED,
INCOMPATIBLE_FIREFOX_FOR_IOS,
INCOMPATIBLE_NOT_FIREFOX,
INCOMPATIBLE_OLD_ROOT_CERT_VERSION,
INCOMPATIBLE_OVER_MAX_VERSION,
INCOMPATIBLE_UNSUPPORTED_PLATFORM,
UNKNOWN,
Expand Down
2 changes: 2 additions & 0 deletions src/amo/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ export const VISIBLE_ADDON_TYPES_MAPPING: {|

// Incompatibility codes for clients that can't install an add-on.
export const INCOMPATIBLE_FIREFOX_FOR_IOS = 'INCOMPATIBLE_FIREFOX_FOR_IOS';
export const INCOMPATIBLE_OLD_ROOT_CERT_VERSION =
'INCOMPATIBLE_OLD_ROOT_CERT_VERSION';
export const INCOMPATIBLE_OVER_MAX_VERSION = 'INCOMPATIBLE_OVER_MAX_VERSION';
export const INCOMPATIBLE_NOT_FIREFOX = 'INCOMPATIBLE_NOT_FIREFOX';
export const INCOMPATIBLE_UNDER_MIN_VERSION = 'INCOMPATIBLE_UNDER_MIN_VERSION';
Expand Down
24 changes: 24 additions & 0 deletions src/amo/utils/compatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
INCOMPATIBLE_ANDROID_UNSUPPORTED,
INCOMPATIBLE_FIREFOX_FOR_IOS,
INCOMPATIBLE_NOT_FIREFOX,
INCOMPATIBLE_OLD_ROOT_CERT_VERSION,
INCOMPATIBLE_OVER_MAX_VERSION,
INCOMPATIBLE_UNDER_MIN_VERSION,
INCOMPATIBLE_UNSUPPORTED_PLATFORM,
Expand Down Expand Up @@ -77,6 +78,25 @@ export const isFirefox = ({
return userAgentInfo.browser.name === 'Firefox';
};

export const isFirefoxWithOldRootCerts = ({
userAgentInfo,
}: {|
userAgentInfo: UserAgentInfoType,
|}): boolean => {
// If the userAgent is false there was likely a programming error.
invariant(userAgentInfo, 'userAgentInfo is required');

const majorAppVersion = parseInt(userAgentInfo.browser?.version, 10);

return (
isFirefox({ userAgentInfo }) &&
// Firefox 128 and higher or latest Firefox ESR 115 have the updated root.
// We can't single out ESR but excluding 115 entirely is good enough.
majorAppVersion < 128 &&
majorAppVersion !== 115
);
};

export const isDesktop = ({
userAgentInfo,
}: {|
Expand Down Expand Up @@ -173,6 +193,10 @@ export function isCompatibleWithUserAgent({
};
}

if (isFirefoxWithOldRootCerts({ userAgentInfo })) {
return { compatible: false, reason: INCOMPATIBLE_OLD_ROOT_CERT_VERSION };
}

// Do version checks, if this add-on has minimum or maximum version
// requirements.
// The addons-moz-compare API is quite strange; a result of
Expand Down