You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request introduces significant improvements to domain squatting protection and configuration flexibility, especially around how protected domains are defined and managed. It also enhances documentation and deployment scripts for better clarity and reliability, and adds support for new webhook event types.
Domain squatting protection and configuration:
The protectedDomains setting for domain squatting detection is now clarified and improved: when set, only those domains are protected, and domains from the URL allowlist are not protected unless protectedDomains is empty. This is reflected in both the schema (config/managed_schema.json) and deployment scripts. [1][2][3][4]
Documentation is updated to explain the new behavior: protected domains are now explicitly set, and allowlisting a site only protects it if protectedDomains is unset. Examples and warnings are added to help admins avoid misconfiguration. [1][2][3]
Deployment and configuration script enhancements:
PowerShell deployment scripts (Deploy-Windows-Chrome-and-Edge.ps1, Detect-Windows-Chrome-and-Edge.ps1, Setup-Windows-Chrome-and-Edge.ps1) are updated to support the new protectedDomains setting, ensuring registry keys are correctly created, removed, and validated. [1][2][3]
Added support for configuring the valid page badge timeout via policy and scripts, with default and range validation. [1][2][3][4]
Webhook and event enhancements:
Added a new domain_squatting_detected event type for webhooks, allowing external systems to be notified when a domain squatting attempt is detected. [1][2][3]
Rules update reliability and documentation:
Improved rules update logic and documentation: if a rules update fails, the extension continues using the last successfully downloaded rules and only falls back to bundled rules if none have ever been downloaded. This ensures continued protection during outages or network problems. [1][2][3]
These changes collectively provide more precise control over domain squatting protection, improve deployment reliability, and clarify configuration for both administrators and end users.
browser-polyfill.js calls chrome.storage.* with a callback, but the mock
only returned a promise, so every storage read in a test hung and the
existing suite was cancelled before any test ran. Accept an optional
callback on storage get/set/remove/clear, return a promise from
runtime.sendMessage like the real API, and record sent messages so
tests can assert on broadcasts.
When a rules update failed (GitHub outage, rate limiting, network
problems), the extension fell back to the bundled rules, which can be
several releases behind and cause false alerts. This happened in two
ways: an expired cache was discarded on startup (frequent with MV3
service worker restarts), and a failed background refresh replaced the
in-memory rules with the bundled ones.
The persisted cache only ever holds rules from a successful remote
fetch, so treat it as the last-known-good copy:
- Load cached rules regardless of age; age still triggers a refresh.
- On a failed fetch, keep the last downloaded rules (from memory or
storage). Bundled rules are used only if nothing was downloaded.
- Reject responses that are not a rules file so they can't replace
good rules.
- Wait at least 5 minutes between attempts after a failure, so an
outage or rate limit doesn't trigger a request on every page load.
- Make forceUpdate() report a failed download instead of success.
Closes#176
- Store the time of the last failed fetch so the retry delay survives
service worker restarts. Previously a restarted worker refetched on
startup even during an outage.
- Have each fetch report its outcome to its caller instead of through
a shared field, so an overlapping fetch can't make "Update Rules Now"
report the wrong result.
Implement fallback mechanism for cached rules fetching
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Kevin Phillips <k.phillips.jr1101@gmail.com>
…tectedDomains
- match combosquats on whole hyphen-separated words, and glued-on text only for names of 5+ letters
- skip edit-distance and typo checks for names under 5 letters and allow 1 edit up to 8 letters
- protect domainSquatting.protectedDomains when set, falling back to the URL allowlist domains
- reload the squatting detector when managed policy changes
…ng webhook
- add protectedDomains and validPageBadgeTimeout to the Windows deploy, detect and setup scripts, the ADMX and the macOS/Firefox templates
- allow domain_squatting_detected in the managed webhook events
- never flag an allowlisted host or its subdomains as squatting
- drop double quotes from ADML webhook help text
Fixes#155Fixes#156Fixes#163
…nd's own glued names
- parse https://*.example.com/* allowlist entries as example.com
- glued combinations (googleusercontent) only count when the added text starts or ends with a suspicious word
This release update improves domain-squatting configuration and rules-update resilience in the Check phishing-protection extension, with supporting enterprise deployment and interface changes.
Changes:
Adds explicit protected-domain settings and refines lookalike detection to reduce false positives.
Retains downloaded rules during update failures, adds retry backoff, and expands regression coverage.
Updates enterprise policies, managed-mode controls, webhook reporting, and documentation.
File
Description
tests/helpers/chrome-mock.js
Supports callback APIs and records runtime messages.
tests/domain-squatting-detector.test.js
Adds protection-scope and lookalike detection tests.
tests/detection-rules-manager.test.js
Tests cache retention, retries, and overlapping updates.
scripts/modules/domain-squatting-detector.js
Adds explicit targets and refines detection heuristics.
scripts/modules/detection-rules-manager.js
Validates downloads, retains cached rules, and manages retries.
scripts/blocked.js
Routes false-positive reports through the background handler.
scripts/background.js
Reinitializes domain protection after policy changes.
rules/detection-rules.json
Replaces URL-pattern lookbehind with an anchored expression.
options/options.js
Adds managed-mode rule updates and hides log clearing.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Insufficient rules validation can replace the last working cache with malformed data that breaks phishing detection, while blocked-page messaging falsely reports failures on supported Chrome 88–98.
blocked.html loads this script without the browser polyfill, but the Promise form of native chrome.runtime.sendMessage requires Chrome 99+. On supported Chrome 88–98, awaiting this call yields undefined, so the UI reports failure even when delivery succeeds. Wrap the callback form in a Promise and reject on chrome.runtime.lastError.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Webhook delivery failures show a generic message instead of the nested error and HTTP status, losing diagnostic details needed to troubleshoot failed reports.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Read nested delivery errors to show webhook failure details
scripts/blocked.js:188
HTTP and network delivery errors are returned under response.result.results[*].error, so this branch shows “Report could not be sent” instead of the actual failure. This loses the HTTP status previously displayed and makes webhook failures harder to diagnose. Read the nested delivery error and response.result.error before falling back to the generic message, while preserving top-level error handling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to domain squatting protection and configuration flexibility, especially around how protected domains are defined and managed. It also enhances documentation and deployment scripts for better clarity and reliability, and adds support for new webhook event types.
Domain squatting protection and configuration:
protectedDomainssetting for domain squatting detection is now clarified and improved: when set, only those domains are protected, and domains from the URL allowlist are not protected unlessprotectedDomainsis empty. This is reflected in both the schema (config/managed_schema.json) and deployment scripts. [1] [2] [3] [4]protectedDomainsis unset. Examples and warnings are added to help admins avoid misconfiguration. [1] [2] [3]Deployment and configuration script enhancements:
Deploy-Windows-Chrome-and-Edge.ps1,Detect-Windows-Chrome-and-Edge.ps1,Setup-Windows-Chrome-and-Edge.ps1) are updated to support the newprotectedDomainssetting, ensuring registry keys are correctly created, removed, and validated. [1] [2] [3]Webhook and event enhancements:
domain_squatting_detectedevent type for webhooks, allowing external systems to be notified when a domain squatting attempt is detected. [1] [2] [3]Rules update reliability and documentation:
These changes collectively provide more precise control over domain squatting protection, improve deployment reliability, and clarify configuration for both administrators and end users.