All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Fixed extension performance issues (#4853)
- Changed the c2 blocklist fetch interval from 15 minutes to 5 minutes (#4850)
- Update the phishing detector validation to drop invalid configs from detector (#4820)
- Produce and export ESM-compatible TypeScript type declaration files in addition to CommonJS-compatible declaration files (#4648)
- Previously, this package shipped with only one variant of type declaration
files, and these files were only CommonJS-compatible, and the
exports
field inpackage.json
linked to these files. This is an anti-pattern and was rightfully flagged by the "Are the Types Wrong?" tool as "masquerading as CJS". All of the ATTW checks now pass.
- Previously, this package shipped with only one variant of type declaration
files, and these files were only CommonJS-compatible, and the
- Remove chunk files (#4648).
- Previously, the build tool we used to generate JavaScript files extracted common code to "chunk" files. While this was intended to make this package more tree-shakeable, it also made debugging more difficult for our development teams. These chunk files are no longer present.
- Add
getHostnameFromUrl
utility function to standardize hostname extraction from URLs (#4645)
- Update
test
,isBlockedRequest
, andbypass
methods to use the hostname for allowlist checks instead of the full origin (#4645)- The previous approach of using the full origin had limitations in dealing with subdomains or variations in the URL structure, which could lead to inconsistent results or false negatives.
- Add allowlist functionality to the C2 domain detection system (#4464)
- Add
PhishingController
functionality for blocking client-side C2 requests by managing a hashed C2 request blocklist (#4526)- Add
requestBlocklist
type toListTypes
. - Add
isBlockedRequest
method toPhishingController
. - Add
isMaliciousRequestDomain
method toPhishingDetector
. - Add handling of
requestBlocklist
inPhishingDetector
configuration. - Add logic to update and check
requestBlocklist
when updating a stale list. - Add
sha256Hash
function to generate SHA-256 hash of a domain.
- Add
- Define and export new types:
PhishingControllerGetStateAction
,PhishingControllerStateChangeEvent
,PhishingControllerEvents
(#4633)
- BREAKING: Add
@noble/hashes
^1.4.0
as dependency (#4526) - BREAKING:: Add
ethereum-cryptography
^2.1.2
as dependency (#4526) - BREAKING:
PhishingControllerMessenger
must allow internal events defined in thePhishingControllerEvents
type (#4633) - Widen
PhishingControllerActions
to include thePhishingController:getState
action (#4633) - Bump
@metamask/base-controller
from^6.0.2
to^6.0.3
(#4625) - Bump
@metamask/controller-utils
from^11.0.2
to^11.1.0
(#4639)
- BREAKING: Remove the Phishfort list from the PhishingController (#4621)
- Bump TypeScript version to
~5.0.4
and setmoduleResolution
option toNode16
(#3645) - Bump
@metamask/base-controller
from^6.0.1
to^6.0.2
(#4544) - Bump
@metamask/controller-utils
from^11.0.1
to^11.0.2
(#4544)
- Port
PhishingDetector
frometh-phishing-detector
; add TypeScript types (#4137) - Add support for IPFS CID blocking to
PhishingDetector
(#4465)
- BREAKING: Bump minimum Node version to 18.18 (#3611)
- Bump
@metamask/base-controller
to^6.0.0
(#4352) - Bump
@metamask/controller-utils
to^11.0.0
(#4352)
- Bump
@metamask/controller-utils
to^10.0.0
(#4342)
- Update phishing detection API endpoint from
*.metafi.codefi.network
to*.api.cx.metamask.io
(#4301)
- Changed Stalelist and hotlist update intervals (#4202)
- Updated the Stalelist update interval to 30 days and the hotlist update interval to 5 mins
- Bump
@metamask/controller-utils
version to~9.1.0
(#4153) - Bump TypeScript version to
~4.9.5
(#4084) - Bump
@metamask/base-controller
to^5.0.2
- Fix
types
field inpackage.json
(#4047)
- BREAKING: Add ESM build (#3998)
- It's no longer possible to import files from
./dist
directly.
- It's no longer possible to import files from
- BREAKING: Bump
@metamask/base-controller
to^5.0.0
(#4039)- This version has a number of breaking changes. See the changelog for more.
- Bump
@metamask/controller-utils
to^9.0.0
(#4039)
- Bump
@metamask/base-controller
to^4.1.1
(#3760, #3821) - Bump
@metamask/controller-utils
to^8.0.2
(#3821)
- Bump
@metamask/base-controller
to^4.0.1
(#3695) - Bump
@metamask/controller-utils
to^8.0.1
(#3695, #3678, #3667, #3580)
- BREAKING: Bump
@metamask/base-controller
to ^4.0.0 (#2063)- This is breaking because the type of the
messenger
has backward-incompatible changes. See the changelog for this package for more.
- This is breaking because the type of the
- Bump
@metamask/controller-utils
to ^6.0.0 (#2063)
- Bump dependency on
@metamask/base-controller
to ^3.2.3 (#1747) - Bump dependency on
@metamask/controller-utils
to ^5.0.2 (#1747)
- BREAKING: Migrate
PhishingController
to BaseControllerV2 (#1705)PhishingController
now expects amessenger
option (and corresponding typePhishingControllerMessenger
is now available)- The constructor takes a single argument, an options bag, instead of three arguments
- The
disabled
configuration is no longer supported
- Update TypeScript to v4.8.x (#1718)
- Bump dependency on
@metamask/controller-utils
to ^5.0.0
- Bump dependency on
@metamask/base-controller
to ^3.2.1 - Bump dependency on
@metamask/controller-utils
to ^4.3.2
- BREAKING: Remove fallback phishing configuration (#1527)
- The default configuration is now blank. A custom initial configuration can still be specified via the constructor to preserve the old behavior.
- BREAKING: Bump to Node 16 (#1262)
- BREAKING: Switch to new phishing configuration API that returns a diff since the last update (#1123)
- The "hotlist" has been replaced by a service that returns any configuration changes since the last update. This should reduce network traffic even further.
- The endpoints used are now
https://phishing-detection.metafi.codefi.network/v1/stalelist
andhttps://phishing-detection.metafi.codefi.network/v1/diffsSince/:lastUpdated
- BREAKING:: The phishing controller state now keeps the MetaMask and PhishFort configuration separate, allowing for proper attribution of each block (#1123)
- The
listState
state property has been replaced with an array of phishing list state objects (one entry for MetaMask, one for PhishFort). - The PhishFort config is deduplicated server-side, so it should have zero overlap with the MetaMask configuration (which helps reduce memory/disk usage)
- The
- BREAKING: Remove
isomorphic-fetch
(#1106)- Consumers must now import
isomorphic-fetch
or another polyfill themselves if they are running in an environment withoutfetch
- Consumers must now import
- BREAKING: Refactor to Cost-Optimized Phishing List Data Architecture. (#1080)
- Rather than periodically downloading two separate configurations (MetaMask and Phishfort), we now download a combined "stalelist" and "hotlist". The stalelist is downloaded every 4 days, and the hotlist is downloaded every 30 minutes. The hotlist only includes data from the last 8 days, which should dramatically reduce the required network traffic for phishing config updates.
- When a site is blocked, we no longer know which list is responsible due to the combined format. We will need to come up with another way to attribute blocks to a specific list; this controller will no longer be responsible for that.
- This change includes the removal of the exports:
METAMASK_CONFIG_FILE
andPHISHFORT_HOTLIST_FILE
(replaced byMETAMASK_STALELIST_FILE
andMETAMASK_HOTLIST_DIFF_FILE
)METAMASK_CONFIG_URL
andPHISHFORT_HOTLIST_URL
(replaced byMETAMASK_STALELIST_URL
andMETAMASK_HOTLIST_DIFF_URL
)EthPhishingResponse
(replaced byPhishingStalelist
for the API response andPhishingListState
for the list in controller state, as they're now different)
- The configuration has changed:
- Instead of accepting a
refreshInterval
, we now accept a separate interval for the stalelist and hotlist (stalelistRefreshInterval
andhotlistRefreshInterval
)
- Instead of accepting a
- The controller state has been updated:
- The phishing list itself has been renamed from
phishing
tolistState
, and the shape has changed. Removing the oldphishing
state would be advised, as it will get replaced by an updated configuration immediately anyway. lastFetched
has been replaced byhotlistLastFetched
andstalelistLastFetched
. The oldlastFetched
state can be removed as well (it never needed to be persisted anyway).
- The phishing list itself has been renamed from
- The
setRefreshInterval
method has been replaced bysetStalelistRefreshInterval
andsetHotlistRefreshInterval
- The
isOutOfDate
method has been replaced byisStalelistOutOfDate
andisHotlistOutOfDate
- The
maybeUpdatePhishingLists
method has been replaced bymaybeUpdateState
- The
updatePhishingLists
method has been replaced byupdateStalelist
andupdateHotlist
- Improve performance of phishing list update (#1086)
- We now use a
Set
+has
method instead of the arrayincludes
method for detecting overlap between phishing lists after an update.
- We now use a
- Add method to conditionally update the phishing lists (#986)
- Relax dependencies on
@metamask/base-controller
and@metamask/controller-utils
(use^
instead of~
) (#998) - Expose
lastFetched
in PhishingController state (#986)
-
Initial release
-
As a result of converting our shared controllers repo into a monorepo (#831), we've created this package from select parts of
@metamask/controllers
v33.0.0, namely:src/third-party/PhishingController.ts
src/third-party/PhishingController.test.ts
All changes listed after this point were applied to this package following the monorepo conversion.
-