From fd12c7c029893bc61736831bed1a3d2ea4102576 Mon Sep 17 00:00:00 2001 From: Alex <55413326+AlexRubik@users.noreply.github.com> Date: Fri, 13 Feb 2026 15:22:49 -0500 Subject: [PATCH] [PM-32088] Switch phishing data source to GitHub (#18890) (#18979) * 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 (cherry picked from commit bfc1833139687bb2b539e377be6fa87aad070049) --- .../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 6595104207a..8ece5e314c5 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 */ @@ -22,8 +20,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( @@ -354,33 +354,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); - }), - ); - }), ); }