@metamask/phishing-controller
Advanced tools
Comparing version 11.0.0 to 12.0.0
@@ -10,2 +10,25 @@ # Changelog | ||
## [12.0.0] | ||
### Added | ||
- Add allowlist functionality to the C2 domain detection system ([#4464](https://github.com/MetaMask/core/pull/4644)) | ||
- Add `PhishingController` functionality for blocking client-side C2 requests by managing a hashed C2 request blocklist ([#4526](https://github.com/MetaMask/core/pull/4526)) | ||
- Add `requestBlocklist` type to `ListTypes`. | ||
- Add `isBlockedRequest` method to `PhishingController`. | ||
- Add `isMaliciousRequestDomain` method to `PhishingDetector`. | ||
- Add handling of `requestBlocklist` in `PhishingDetector` configuration. | ||
- Add logic to update and check `requestBlocklist` when updating a stale list. | ||
- Add `sha256Hash` function to generate SHA-256 hash of a domain. | ||
- Define and export new types: `PhishingControllerGetStateAction`, `PhishingControllerStateChangeEvent`, `PhishingControllerEvents` ([#4633](https://github.com/MetaMask/core/pull/4633)) | ||
### Changed | ||
- **BREAKING:** Add `@noble/hashes` `^1.4.0` as dependency ([#4526](https://github.com/MetaMask/core/pull/4526)) | ||
- **BREAKING:**: Add `ethereum-cryptography` `^2.1.2` as dependency ([#4526](https://github.com/MetaMask/core/pull/4526)) | ||
- **BREAKING:** `PhishingControllerMessenger` must allow internal events defined in the `PhishingControllerEvents` type ([#4633](https://github.com/MetaMask/core/pull/4633)) | ||
- Widen `PhishingControllerActions` to include the `PhishingController:getState` action ([#4633](https://github.com/MetaMask/core/pull/4633)) | ||
- Bump `@metamask/base-controller` from `^6.0.2` to `^6.0.3` ([#4625](https://github.com/MetaMask/core/pull/4625)) | ||
- Bump `@metamask/controller-utils` from `^11.0.2` to `^11.1.0` ([#4639](https://github.com/MetaMask/core/pull/4639)) | ||
## [11.0.0] | ||
@@ -232,3 +255,4 @@ | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@11.0.0...HEAD | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@12.0.0...HEAD | ||
[12.0.0]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@11.0.0...@metamask/phishing-controller@12.0.0 | ||
[11.0.0]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@10.1.1...@metamask/phishing-controller@11.0.0 | ||
@@ -235,0 +259,0 @@ [10.1.1]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@10.1.0...@metamask/phishing-controller@10.1.1 |
@@ -13,3 +13,8 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkFACB7CYRjs = require('./chunk-FACB7CYR.js'); | ||
var _chunkXZNT2KYXjs = require('./chunk-XZNT2KYX.js'); | ||
require('./chunk-5NDIXQG5.js'); | ||
require('./chunk-Z4BLTVTB.js'); | ||
@@ -28,3 +33,7 @@ | ||
exports.HOTLIST_REFRESH_INTERVAL = _chunkFACB7CYRjs.HOTLIST_REFRESH_INTERVAL; exports.ListKeys = _chunkFACB7CYRjs.ListKeys; exports.ListNames = _chunkFACB7CYRjs.ListNames; exports.METAMASK_HOTLIST_DIFF_FILE = _chunkFACB7CYRjs.METAMASK_HOTLIST_DIFF_FILE; exports.METAMASK_HOTLIST_DIFF_URL = _chunkFACB7CYRjs.METAMASK_HOTLIST_DIFF_URL; exports.METAMASK_STALELIST_FILE = _chunkFACB7CYRjs.METAMASK_STALELIST_FILE; exports.METAMASK_STALELIST_URL = _chunkFACB7CYRjs.METAMASK_STALELIST_URL; exports.PHISHING_CONFIG_BASE_URL = _chunkFACB7CYRjs.PHISHING_CONFIG_BASE_URL; exports.PhishingController = _chunkFACB7CYRjs.PhishingController; exports.STALELIST_REFRESH_INTERVAL = _chunkFACB7CYRjs.STALELIST_REFRESH_INTERVAL; exports.phishingListKeyNameMap = _chunkFACB7CYRjs.phishingListKeyNameMap; | ||
exports.C2_DOMAIN_BLOCKLIST_ENDPOINT = _chunkXZNT2KYXjs.C2_DOMAIN_BLOCKLIST_ENDPOINT; exports.C2_DOMAIN_BLOCKLIST_REFRESH_INTERVAL = _chunkXZNT2KYXjs.C2_DOMAIN_BLOCKLIST_REFRESH_INTERVAL; exports.C2_DOMAIN_BLOCKLIST_URL = _chunkXZNT2KYXjs.C2_DOMAIN_BLOCKLIST_URL; exports.CLIENT_SIDE_DETECION_BASE_URL = _chunkXZNT2KYXjs.CLIENT_SIDE_DETECION_BASE_URL; exports.HOTLIST_REFRESH_INTERVAL = _chunkXZNT2KYXjs.HOTLIST_REFRESH_INTERVAL; exports.ListKeys = _chunkXZNT2KYXjs.ListKeys; exports.ListNames = _chunkXZNT2KYXjs.ListNames; exports.METAMASK_HOTLIST_DIFF_FILE = _chunkXZNT2KYXjs.METAMASK_HOTLIST_DIFF_FILE; exports.METAMASK_HOTLIST_DIFF_URL = _chunkXZNT2KYXjs.METAMASK_HOTLIST_DIFF_URL; exports.METAMASK_STALELIST_FILE = _chunkXZNT2KYXjs.METAMASK_STALELIST_FILE; exports.METAMASK_STALELIST_URL = _chunkXZNT2KYXjs.METAMASK_STALELIST_URL; exports.PHISHING_CONFIG_BASE_URL = _chunkXZNT2KYXjs.PHISHING_CONFIG_BASE_URL; exports.PhishingController = _chunkXZNT2KYXjs.PhishingController; exports.STALELIST_REFRESH_INTERVAL = _chunkXZNT2KYXjs.STALELIST_REFRESH_INTERVAL; exports.phishingListKeyNameMap = _chunkXZNT2KYXjs.phishingListKeyNameMap; | ||
//# sourceMappingURL=index.js.map |
@@ -14,3 +14,8 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkFACB7CYRjs = require('./chunk-FACB7CYR.js'); | ||
var _chunkXZNT2KYXjs = require('./chunk-XZNT2KYX.js'); | ||
require('./chunk-5NDIXQG5.js'); | ||
require('./chunk-Z4BLTVTB.js'); | ||
@@ -30,3 +35,7 @@ | ||
exports.HOTLIST_REFRESH_INTERVAL = _chunkFACB7CYRjs.HOTLIST_REFRESH_INTERVAL; exports.ListKeys = _chunkFACB7CYRjs.ListKeys; exports.ListNames = _chunkFACB7CYRjs.ListNames; exports.METAMASK_HOTLIST_DIFF_FILE = _chunkFACB7CYRjs.METAMASK_HOTLIST_DIFF_FILE; exports.METAMASK_HOTLIST_DIFF_URL = _chunkFACB7CYRjs.METAMASK_HOTLIST_DIFF_URL; exports.METAMASK_STALELIST_FILE = _chunkFACB7CYRjs.METAMASK_STALELIST_FILE; exports.METAMASK_STALELIST_URL = _chunkFACB7CYRjs.METAMASK_STALELIST_URL; exports.PHISHING_CONFIG_BASE_URL = _chunkFACB7CYRjs.PHISHING_CONFIG_BASE_URL; exports.PhishingController = _chunkFACB7CYRjs.PhishingController; exports.STALELIST_REFRESH_INTERVAL = _chunkFACB7CYRjs.STALELIST_REFRESH_INTERVAL; exports.default = _chunkFACB7CYRjs.PhishingController_default; exports.phishingListKeyNameMap = _chunkFACB7CYRjs.phishingListKeyNameMap; | ||
exports.C2_DOMAIN_BLOCKLIST_ENDPOINT = _chunkXZNT2KYXjs.C2_DOMAIN_BLOCKLIST_ENDPOINT; exports.C2_DOMAIN_BLOCKLIST_REFRESH_INTERVAL = _chunkXZNT2KYXjs.C2_DOMAIN_BLOCKLIST_REFRESH_INTERVAL; exports.C2_DOMAIN_BLOCKLIST_URL = _chunkXZNT2KYXjs.C2_DOMAIN_BLOCKLIST_URL; exports.CLIENT_SIDE_DETECION_BASE_URL = _chunkXZNT2KYXjs.CLIENT_SIDE_DETECION_BASE_URL; exports.HOTLIST_REFRESH_INTERVAL = _chunkXZNT2KYXjs.HOTLIST_REFRESH_INTERVAL; exports.ListKeys = _chunkXZNT2KYXjs.ListKeys; exports.ListNames = _chunkXZNT2KYXjs.ListNames; exports.METAMASK_HOTLIST_DIFF_FILE = _chunkXZNT2KYXjs.METAMASK_HOTLIST_DIFF_FILE; exports.METAMASK_HOTLIST_DIFF_URL = _chunkXZNT2KYXjs.METAMASK_HOTLIST_DIFF_URL; exports.METAMASK_STALELIST_FILE = _chunkXZNT2KYXjs.METAMASK_STALELIST_FILE; exports.METAMASK_STALELIST_URL = _chunkXZNT2KYXjs.METAMASK_STALELIST_URL; exports.PHISHING_CONFIG_BASE_URL = _chunkXZNT2KYXjs.PHISHING_CONFIG_BASE_URL; exports.PhishingController = _chunkXZNT2KYXjs.PhishingController; exports.STALELIST_REFRESH_INTERVAL = _chunkXZNT2KYXjs.STALELIST_REFRESH_INTERVAL; exports.default = _chunkXZNT2KYXjs.PhishingController_default; exports.phishingListKeyNameMap = _chunkXZNT2KYXjs.phishingListKeyNameMap; | ||
//# sourceMappingURL=PhishingController.js.map |
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkFACB7CYRjs = require('./chunk-FACB7CYR.js'); | ||
var _chunkXZNT2KYXjs = require('./chunk-XZNT2KYX.js'); | ||
require('./chunk-5NDIXQG5.js'); | ||
require('./chunk-Z4BLTVTB.js'); | ||
exports.PhishingDetector = _chunkFACB7CYRjs.PhishingDetector; | ||
exports.PhishingDetector = _chunkXZNT2KYXjs.PhishingDetector; | ||
//# sourceMappingURL=PhishingDetector.js.map |
@@ -1,6 +0,10 @@ | ||
import type { RestrictedControllerMessenger } from '@metamask/base-controller'; | ||
import type { ControllerGetStateAction, ControllerStateChangeEvent, RestrictedControllerMessenger } from '@metamask/base-controller'; | ||
import { BaseController } from '@metamask/base-controller'; | ||
import { type PhishingDetectorResult } from './types'; | ||
export declare const PHISHING_CONFIG_BASE_URL = "https://phishing-detection.api.cx.metamask.io"; | ||
export declare const METAMASK_STALELIST_FILE = "/v1/stalelist"; | ||
export declare const METAMASK_HOTLIST_DIFF_FILE = "/v1/diffsSince"; | ||
export declare const CLIENT_SIDE_DETECION_BASE_URL = "https://client-side-detection.api.cx.metamask.io"; | ||
export declare const C2_DOMAIN_BLOCKLIST_ENDPOINT = "/v1/request-blocklist"; | ||
export declare const C2_DOMAIN_BLOCKLIST_REFRESH_INTERVAL: number; | ||
export declare const HOTLIST_REFRESH_INTERVAL: number; | ||
@@ -10,2 +14,3 @@ export declare const STALELIST_REFRESH_INTERVAL: number; | ||
export declare const METAMASK_HOTLIST_DIFF_URL = "https://phishing-detection.api.cx.metamask.io/v1/diffsSince"; | ||
export declare const C2_DOMAIN_BLOCKLIST_URL = "https://client-side-detection.api.cx.metamask.io/v1/request-blocklist"; | ||
/** | ||
@@ -16,3 +21,3 @@ * @type ListTypes | ||
*/ | ||
export type ListTypes = 'fuzzylist' | 'blocklist' | 'allowlist'; | ||
export type ListTypes = 'fuzzylist' | 'blocklist' | 'allowlist' | 'c2DomainBlocklist'; | ||
/** | ||
@@ -37,2 +42,15 @@ * @type EthPhishingResponse | ||
/** | ||
* @type C2DomainBlocklistResponse | ||
* | ||
* Response for blocklist update requests | ||
* @property recentlyAdded - List of c2 domains recently added to the blocklist | ||
* @property recentlyRemoved - List of c2 domains recently removed from the blocklist | ||
* @property lastFetchedAt - Timestamp of the last fetch request | ||
*/ | ||
export type C2DomainBlocklistResponse = { | ||
recentlyAdded: string[]; | ||
recentlyRemoved: string[]; | ||
lastFetchedAt: string; | ||
}; | ||
/** | ||
* @type PhishingStalelist | ||
@@ -58,2 +76,3 @@ * | ||
* @property blocklist - List of unapproved origins (legacy naming "blacklist") | ||
* @property c2DomainBlocklist - List of hashed hostnames that C2 requests are blocked against. | ||
* @property fuzzylist - List of fuzzy-matched unapproved origins | ||
@@ -68,2 +87,3 @@ * @property tolerance - Fuzzy match tolerance level | ||
blocklist: string[]; | ||
c2DomainBlocklist: string[]; | ||
fuzzylist: string[]; | ||
@@ -76,19 +96,2 @@ tolerance: number; | ||
/** | ||
* @type EthPhishingDetectResult | ||
* | ||
* type that describes the result of the `test` method. | ||
* @property name - Name of the config on which a match was found. | ||
* @property version - Version of the config on which a match was found. | ||
* @property result - Whether a domain was detected as a phishing domain. True means an unsafe domain. | ||
* @property match - The matching fuzzylist origin when a fuzzylist match is found. Returned as undefined for non-fuzzy true results. | ||
* @property type - The field of the config on which a match was found. | ||
*/ | ||
export type EthPhishingDetectResult = { | ||
name?: string; | ||
version?: string; | ||
result: boolean; | ||
match?: string; | ||
type: 'all' | 'fuzzy' | 'blocklist' | 'allowlist'; | ||
}; | ||
/** | ||
* @type HotlistDiff | ||
@@ -154,2 +157,3 @@ * | ||
stalelistLastFetched: number; | ||
c2DomainBlocklistLastFetched: number; | ||
}; | ||
@@ -162,2 +166,3 @@ /** | ||
* @property hotlistRefreshInterval - Polling interval used to fetch hotlist diff list. | ||
* @property c2DomainBlocklistRefreshInterval - Polling interval used to fetch c2 domain blocklist. | ||
*/ | ||
@@ -167,2 +172,3 @@ export type PhishingControllerOptions = { | ||
hotlistRefreshInterval?: number; | ||
c2DomainBlocklistRefreshInterval?: number; | ||
messenger: PhishingControllerMessenger; | ||
@@ -179,4 +185,7 @@ state?: Partial<PhishingControllerState>; | ||
}; | ||
export type PhishingControllerActions = MaybeUpdateState | TestOrigin; | ||
export type PhishingControllerMessenger = RestrictedControllerMessenger<typeof controllerName, PhishingControllerActions, never, never, never>; | ||
export type PhishingControllerGetStateAction = ControllerGetStateAction<typeof controllerName, PhishingControllerState>; | ||
export type PhishingControllerActions = PhishingControllerGetStateAction | MaybeUpdateState | TestOrigin; | ||
export type PhishingControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, PhishingControllerState>; | ||
export type PhishingControllerEvents = PhishingControllerStateChangeEvent; | ||
export type PhishingControllerMessenger = RestrictedControllerMessenger<typeof controllerName, PhishingControllerActions, PhishingControllerEvents, never, never>; | ||
/** | ||
@@ -193,6 +202,7 @@ * Controller that manages community-maintained lists of approved and unapproved website origins. | ||
* @param config.hotlistRefreshInterval - Polling interval used to fetch hotlist diff list. | ||
* @param config.c2DomainBlocklistRefreshInterval - Polling interval used to fetch c2 domain blocklist. | ||
* @param config.messenger - The controller restricted messenger. | ||
* @param config.state - Initial state to set on this controller. | ||
*/ | ||
constructor({ stalelistRefreshInterval, hotlistRefreshInterval, messenger, state, }: PhishingControllerOptions); | ||
constructor({ stalelistRefreshInterval, hotlistRefreshInterval, c2DomainBlocklistRefreshInterval, messenger, state, }: PhishingControllerOptions); | ||
/** | ||
@@ -219,2 +229,10 @@ * Updates this.detector with an instance of PhishingDetector using the current state. | ||
/** | ||
* Set the interval at which the C2 domain blocklist will be refetched. | ||
* Fetching will only occur on the next call to test/bypass. | ||
* For immediate update to the phishing list, call {@link updateHotlist} directly. | ||
* | ||
* @param interval - the new interval, in ms. | ||
*/ | ||
setC2DomainBlocklistRefreshInterval(interval: number): void; | ||
/** | ||
* Determine if an update to the stalelist configuration is needed. | ||
@@ -232,2 +250,8 @@ * | ||
/** | ||
* Determine if an update to the C2 domain blocklist is needed. | ||
* | ||
* @returns Whether an update is needed | ||
*/ | ||
isC2DomainBlocklistOutOfDate(): boolean; | ||
/** | ||
* Conditionally update the phishing configuration. | ||
@@ -237,3 +261,3 @@ * | ||
* to update the configuration. This will automatically grab the hotlist, | ||
* so it isn't necessary to continue on to download the hotlist. | ||
* so it isn't necessary to continue on to download the hotlist and the c2 domain blocklist. | ||
* | ||
@@ -252,4 +276,15 @@ */ | ||
*/ | ||
test(origin: string): EthPhishingDetectResult; | ||
test(origin: string): PhishingDetectorResult; | ||
/** | ||
* Checks if a request URL's domain is blocked against the request blocklist. | ||
* | ||
* This method is used to determine if a specific request URL is associated with a malicious | ||
* command and control (C2) domain. The URL's hostname is hashed and checked against a configured | ||
* blocklist of known malicious domains. | ||
* | ||
* @param origin - The full request URL to be checked. | ||
* @returns An object indicating whether the URL's domain is blocked and relevant metadata. | ||
*/ | ||
isBlockedRequest(origin: string): PhishingDetectorResult; | ||
/** | ||
* Temporarily marks a given origin as approved. | ||
@@ -261,2 +296,9 @@ * | ||
/** | ||
* Update the C2 domain blocklist. | ||
* | ||
* If an update is in progress, no additional update will be made. Instead this will wait until | ||
* the in-progress update has finished. | ||
*/ | ||
updateC2DomainBlocklist(): Promise<void>; | ||
/** | ||
* Update the hotlist. | ||
@@ -277,2 +319,3 @@ * | ||
export default PhishingController; | ||
export type { PhishingDetectorResult }; | ||
//# sourceMappingURL=PhishingController.d.ts.map |
@@ -0,4 +1,6 @@ | ||
import { type PhishingDetectorResult } from './types'; | ||
export type LegacyPhishingDetectorList = { | ||
whitelist?: string[]; | ||
blacklist?: string[]; | ||
c2DomainBlocklist?: string[]; | ||
} & FuzzyTolerance; | ||
@@ -8,4 +10,6 @@ export type PhishingDetectorList = { | ||
blocklist?: string[]; | ||
c2DomainBlocklist?: string[]; | ||
name?: string; | ||
version?: string | number; | ||
tolerance?: number; | ||
} & FuzzyTolerance; | ||
@@ -25,42 +29,6 @@ export type FuzzyTolerance = { | ||
blocklist: string[][]; | ||
c2DomainBlocklist?: string[]; | ||
fuzzylist: string[][]; | ||
tolerance: number; | ||
}; | ||
/** | ||
* Represents the result of checking a domain. | ||
*/ | ||
export type PhishingDetectorResult = { | ||
/** | ||
* The name of the configuration object in which the domain was found within | ||
* an allowlist, blocklist, or fuzzylist. | ||
*/ | ||
name?: string; | ||
/** | ||
* The version associated with the configuration object in which the domain | ||
* was found within an allowlist, blocklist, or fuzzylist. | ||
*/ | ||
version?: string; | ||
/** | ||
* Whether the domain is regarded as allowed (true) or not (false). | ||
*/ | ||
result: boolean; | ||
/** | ||
* A normalized version of the domain, which is only constructed if the domain | ||
* is found within a list. | ||
*/ | ||
match?: string; | ||
/** | ||
* Which type of list in which the domain was found. | ||
* | ||
* - "allowlist" means that the domain was found in the allowlist. | ||
* - "blocklist" means that the domain was found in the blocklist. | ||
* - "fuzzy" means that the domain was found in the fuzzylist. | ||
* - "blacklist" means that the domain was found in a blacklist of a legacy | ||
* configuration object. | ||
* - "whitelist" means that the domain was found in a whitelist of a legacy | ||
* configuration object. | ||
* - "all" means that the domain was not found in any list. | ||
*/ | ||
type: 'all' | 'fuzzy' | 'blocklist' | 'allowlist' | 'blacklist' | 'whitelist'; | ||
}; | ||
export declare class PhishingDetector { | ||
@@ -88,3 +56,12 @@ #private; | ||
check(url: string): PhishingDetectorResult; | ||
/** | ||
* Checks if a URL is blocked against the hashed request blocklist. | ||
* This is done by hashing the URL's hostname and checking it against the hashed request blocklist. | ||
* | ||
* | ||
* @param urlString - The URL to check. | ||
* @returns An object indicating if the URL is blocked and relevant metadata. | ||
*/ | ||
isMaliciousC2Domain(urlString: string): PhishingDetectorResult; | ||
} | ||
//# sourceMappingURL=PhishingDetector.d.ts.map |
@@ -1,2 +0,3 @@ | ||
import type { Hotlist, ListKeys, PhishingListState } from './PhishingController'; | ||
import type { Hotlist, PhishingListState } from './PhishingController'; | ||
import { ListKeys } from './PhishingController'; | ||
import type { PhishingDetectorList, PhishingDetectorConfiguration } from './PhishingDetector'; | ||
@@ -10,2 +11,9 @@ /** | ||
/** | ||
* Rounds a Unix timestamp down to the nearest minute. | ||
* | ||
* @param unixTimestamp - The Unix timestamp to be rounded. | ||
* @returns The rounded Unix timestamp. | ||
*/ | ||
export declare function roundToNearestMinute(unixTimestamp: number): number; | ||
/** | ||
* Determines which diffs are applicable to the listState, then applies those diffs. | ||
@@ -16,5 +24,7 @@ * | ||
* @param listKey - the key associated with the input/output phishing list state. | ||
* @param recentlyAddedC2Domains - list of hashed C2 domains to add to the local c2 domain blocklist | ||
* @param recentlyRemovedC2Domains - list of hashed C2 domains to remove from the local c2 domain blocklist | ||
* @returns the new list state | ||
*/ | ||
export declare const applyDiffs: (listState: PhishingListState, hotlistDiffs: Hotlist, listKey: ListKeys) => PhishingListState; | ||
export declare const applyDiffs: (listState: PhishingListState, hotlistDiffs: Hotlist, listKey: ListKeys, recentlyAddedC2Domains?: string[], recentlyRemovedC2Domains?: string[]) => PhishingListState; | ||
/** | ||
@@ -47,2 +57,3 @@ * Validates the configuration object for the phishing detector. | ||
* @param override.blocklist - the optional blocklist to override. | ||
* @param override.c2DomainBlocklist - the optional c2DomainBlocklist to override. | ||
* @param override.fuzzylist - the optional fuzzylist to override. | ||
@@ -55,2 +66,3 @@ * @param override.tolerance - the optional tolerance to override. | ||
blocklist?: string[] | undefined; | ||
c2DomainBlocklist?: string[] | undefined; | ||
fuzzylist?: string[] | undefined; | ||
@@ -70,2 +82,3 @@ tolerance?: number | undefined; | ||
blocklist: string[][]; | ||
c2DomainBlocklist: string[]; | ||
fuzzylist: string[][]; | ||
@@ -97,2 +110,9 @@ tolerance: number; | ||
export declare const matchPartsAgainstList: (source: string[], list: string[][]) => string[] | undefined; | ||
/** | ||
* Generate the SHA-256 hash of a hostname. | ||
* | ||
* @param hostname - The hostname to hash. | ||
* @returns The SHA-256 hash of the hostname. | ||
*/ | ||
export declare const sha256Hash: (hostname: string) => string; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -12,3 +12,6 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkFACB7CYRjs = require('./chunk-FACB7CYR.js'); | ||
var _chunkXZNT2KYXjs = require('./chunk-XZNT2KYX.js'); | ||
require('./chunk-5NDIXQG5.js'); | ||
require('./chunk-Z4BLTVTB.js'); | ||
@@ -26,3 +29,5 @@ | ||
exports.applyDiffs = _chunkFACB7CYRjs.applyDiffs; exports.domainPartsToDomain = _chunkFACB7CYRjs.domainPartsToDomain; exports.domainPartsToFuzzyForm = _chunkFACB7CYRjs.domainPartsToFuzzyForm; exports.domainToParts = _chunkFACB7CYRjs.domainToParts; exports.fetchTimeNow = _chunkFACB7CYRjs.fetchTimeNow; exports.getDefaultPhishingDetectorConfig = _chunkFACB7CYRjs.getDefaultPhishingDetectorConfig; exports.matchPartsAgainstList = _chunkFACB7CYRjs.matchPartsAgainstList; exports.processConfigs = _chunkFACB7CYRjs.processConfigs; exports.processDomainList = _chunkFACB7CYRjs.processDomainList; exports.validateConfig = _chunkFACB7CYRjs.validateConfig; | ||
exports.applyDiffs = _chunkXZNT2KYXjs.applyDiffs; exports.domainPartsToDomain = _chunkXZNT2KYXjs.domainPartsToDomain; exports.domainPartsToFuzzyForm = _chunkXZNT2KYXjs.domainPartsToFuzzyForm; exports.domainToParts = _chunkXZNT2KYXjs.domainToParts; exports.fetchTimeNow = _chunkXZNT2KYXjs.fetchTimeNow; exports.getDefaultPhishingDetectorConfig = _chunkXZNT2KYXjs.getDefaultPhishingDetectorConfig; exports.matchPartsAgainstList = _chunkXZNT2KYXjs.matchPartsAgainstList; exports.processConfigs = _chunkXZNT2KYXjs.processConfigs; exports.processDomainList = _chunkXZNT2KYXjs.processDomainList; exports.roundToNearestMinute = _chunkXZNT2KYXjs.roundToNearestMinute; exports.sha256Hash = _chunkXZNT2KYXjs.sha256Hash; exports.validateConfig = _chunkXZNT2KYXjs.validateConfig; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@metamask/phishing-controller", | ||
"version": "11.0.0", | ||
"version": "12.0.0", | ||
"description": "Maintains a periodically updated list of approved and unapproved website origins", | ||
@@ -38,2 +38,3 @@ "keywords": [ | ||
"publish:preview": "yarn npm publish --tag preview", | ||
"since-latest-release": "../../scripts/since-latest-release.sh", | ||
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter", | ||
@@ -45,6 +46,8 @@ "test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache", | ||
"dependencies": { | ||
"@metamask/base-controller": "^6.0.2", | ||
"@metamask/controller-utils": "^11.0.2", | ||
"@metamask/base-controller": "^6.0.3", | ||
"@metamask/controller-utils": "^11.1.0", | ||
"@noble/hashes": "^1.4.0", | ||
"@types/punycode": "^2.1.0", | ||
"eth-phishing-detect": "^1.2.0", | ||
"ethereum-cryptography": "^2.1.2", | ||
"fastest-levenshtein": "^1.0.16", | ||
@@ -51,0 +54,0 @@ "punycode": "^2.1.1" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
290635
53
2344
8