From ead4cc7f4e9962d80fceec463e850038e56bf2db Mon Sep 17 00:00:00 2001 From: Alex <55413326+AlexRubik@users.noreply.github.com> Date: Thu, 12 Feb 2026 12:29:18 -0500 Subject: [PATCH] [PM-32088] Switch phishing data source to GitHub (#18890) * Switch phishing data source to GitHub and remove fallback mechanism The phish.co.za mirror is down, causing every update cycle to timeout on the primary fetch before falling back to the GitHub raw URL. This removes phish.co.za entirely and uses GitHub as the sole data source, which was the original source before the mirror was introduced. - Rename `remoteUrl`/`fallbackUrl` to `ghSourceUrl` on PhishingResource type - Remove phish.co.za URLs from both Domains and Links resources - Remove catchError fallback block in `_updateFullDataSet()` - Errors now propagate to `_backgroundUpdate()` which already handles retries (3 attempts with 5-minute delays) and graceful degradation * revert the fallback logic removal, change prop name, add use fallback flag * Update Links primaryUrl to Bitwarden-hosted blocklist * remove all fallback logic --- .../phishing-detection/phishing-resources.ts | 11 ++----- .../services/phishing-data.service.ts | 33 ++----------------- 2 files changed, 6 insertions(+), 38 deletions(-) diff --git a/apps/browser/src/dirt/phishing-detection/phishing-resources.ts b/apps/browser/src/dirt/phishing-detection/phishing-resources.ts index 88068987dd7..1c6421912ab 100644 --- a/apps/browser/src/dirt/phishing-detection/phishing-resources.ts +++ b/apps/browser/src/dirt/phishing-detection/phishing-resources.ts @@ -1,8 +1,6 @@ export type PhishingResource = { name?: string; - remoteUrl: string; - /** Fallback URL to use if remoteUrl fails (e.g., due to SSL interception/cert issues) */ - fallbackUrl: string; + primaryUrl: string; checksumUrl: string; todayUrl: string; /** Matcher used to decide whether a given URL matches an entry from this resource */ @@ -20,8 +18,7 @@ export const PHISHING_RESOURCES: Record new Error("Invalid resource URL")); } - this.logService.info(`[PhishingDataService] Starting FULL update using ${resource.remoteUrl}`); - return from(this.apiService.nativeFetch(new Request(resource.remoteUrl))).pipe( + this.logService.info(`[PhishingDataService] Starting FULL update using ${resource.primaryUrl}`); + return from(this.apiService.nativeFetch(new Request(resource.primaryUrl))).pipe( switchMap((response) => { if (!response.ok || !response.body) { return throwError( @@ -322,33 +322,6 @@ export class PhishingDataService { return from(this.indexedDbService.saveUrlsFromStream(response.body)); }), - catchError((err: unknown) => { - this.logService.error( - `[PhishingDataService] Full dataset update failed using primary source ${err}`, - ); - this.logService.warning( - `[PhishingDataService] Falling back to: ${resource.fallbackUrl} (Note: Fallback data may be less up-to-date)`, - ); - // Try fallback URL - return from(this.apiService.nativeFetch(new Request(resource.fallbackUrl))).pipe( - switchMap((fallbackResponse) => { - if (!fallbackResponse.ok || !fallbackResponse.body) { - return throwError( - () => - new Error( - `[PhishingDataService] Fallback fetch failed: ${fallbackResponse.status}, ${fallbackResponse.statusText}`, - ), - ); - } - - return from(this.indexedDbService.saveUrlsFromStream(fallbackResponse.body)); - }), - catchError((fallbackError: unknown) => { - this.logService.error(`[PhishingDataService] Fallback source failed`); - return throwError(() => fallbackError); - }), - ); - }), ); }