@metamask-previews/phishing-controller 17.4.0-preview-eb263b0ee → 17.4.0-preview-5b293ee50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/PhishingController.cjs +134 -337
- package/dist/PhishingController.cjs.map +1 -1
- package/dist/PhishingController.d.cts +7 -196
- package/dist/PhishingController.d.cts.map +1 -1
- package/dist/PhishingController.d.mts +7 -196
- package/dist/PhishingController.d.mts.map +1 -1
- package/dist/PhishingController.mjs +114 -335
- package/dist/PhishingController.mjs.map +1 -1
- package/dist/PhishingDataService-method-action-types.cjs +7 -0
- package/dist/PhishingDataService-method-action-types.cjs.map +1 -0
- package/dist/PhishingDataService-method-action-types.d.cts +121 -0
- package/dist/PhishingDataService-method-action-types.d.cts.map +1 -0
- package/dist/PhishingDataService-method-action-types.d.mts +121 -0
- package/dist/PhishingDataService-method-action-types.d.mts.map +1 -0
- package/dist/PhishingDataService-method-action-types.mjs +6 -0
- package/dist/PhishingDataService-method-action-types.mjs.map +1 -0
- package/dist/PhishingDataService.cjs +498 -0
- package/dist/PhishingDataService.cjs.map +1 -0
- package/dist/PhishingDataService.d.cts +211 -0
- package/dist/PhishingDataService.d.cts.map +1 -0
- package/dist/PhishingDataService.d.mts +211 -0
- package/dist/PhishingDataService.d.mts.map +1 -0
- package/dist/PhishingDataService.mjs +494 -0
- package/dist/PhishingDataService.mjs.map +1 -0
- package/dist/index.cjs +6 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +5 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types.cjs +30 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +155 -0
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +155 -0
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +29 -0
- package/dist/types.mjs.map +1 -1
- package/dist/utils.cjs +3 -52
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +2 -32
- package/dist/utils.d.cts.map +1 -1
- package/dist/utils.d.mts +2 -32
- package/dist/utils.d.mts.map +1 -1
- package/dist/utils.mjs +1 -48
- package/dist/utils.mjs.map +1 -1
- package/package.json +6 -1
- package/dist/CacheManager.cjs +0 -177
- package/dist/CacheManager.cjs.map +0 -1
- package/dist/CacheManager.d.cts +0 -104
- package/dist/CacheManager.d.cts.map +0 -1
- package/dist/CacheManager.d.mts +0 -104
- package/dist/CacheManager.d.mts.map +0 -1
- package/dist/CacheManager.mjs +0 -173
- package/dist/CacheManager.mjs.map +0 -1
|
@@ -3,169 +3,16 @@ import { BaseController } from "@metamask/base-controller";
|
|
|
3
3
|
import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller";
|
|
4
4
|
import type { Messenger } from "@metamask/messenger";
|
|
5
5
|
import type { TransactionControllerGetStateAction, TransactionControllerStateChangeEvent } from "@metamask/transaction-controller";
|
|
6
|
-
import type { CacheEntry } from "./CacheManager.cjs";
|
|
7
6
|
import type { PathTrie } from "./PathTrie.cjs";
|
|
8
7
|
import type { PhishingControllerMaybeUpdateStateAction, PhishingControllerMethodActions, PhishingControllerTestOriginAction } from "./PhishingController-method-action-types.cjs";
|
|
9
|
-
import type {
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export declare const C2_DOMAIN_BLOCKLIST_ENDPOINT = "/v1/request-blocklist";
|
|
15
|
-
export declare const PHISHING_DETECTION_BASE_URL = "https://dapp-scanning.api.cx.metamask.io";
|
|
16
|
-
export declare const PHISHING_DETECTION_SCAN_ENDPOINT = "v2/scan";
|
|
17
|
-
export declare const PHISHING_DETECTION_BULK_SCAN_ENDPOINT = "bulk-scan";
|
|
18
|
-
export declare const SECURITY_ALERTS_BASE_URL = "https://security-alerts.api.cx.metamask.io";
|
|
19
|
-
export declare const TOKEN_BULK_SCANNING_ENDPOINT = "/token/scan-bulk";
|
|
20
|
-
export declare const ADDRESS_SCAN_ENDPOINT = "/address/evm/scan";
|
|
21
|
-
export declare const APPROVALS_ENDPOINT = "/address/evm/approvals";
|
|
22
|
-
export declare const DEFAULT_URL_SCAN_CACHE_TTL: number;
|
|
23
|
-
export declare const DEFAULT_URL_SCAN_CACHE_MAX_SIZE = 250;
|
|
24
|
-
export declare const DEFAULT_TOKEN_SCAN_CACHE_TTL: number;
|
|
25
|
-
export declare const DEFAULT_TOKEN_SCAN_CACHE_MAX_SIZE = 1000;
|
|
26
|
-
export declare const DEFAULT_ADDRESS_SCAN_CACHE_TTL: number;
|
|
27
|
-
export declare const DEFAULT_ADDRESS_SCAN_CACHE_MAX_SIZE = 1000;
|
|
8
|
+
import type { PhishingDataServiceMethodActions } from "./PhishingDataService-method-action-types.cjs";
|
|
9
|
+
import type { PhishingDetectorResult, PhishingDetectionScanResult, BulkTokenScanResponse, BulkTokenScanRequest, AddressScanResult, SimilarAddressMatch, ApprovalsResponse, BulkPhishingDetectionScanResponse, PhishingListState } from "./types.cjs";
|
|
10
|
+
export { PHISHING_CONFIG_BASE_URL, METAMASK_STALELIST_FILE, METAMASK_HOTLIST_DIFF_FILE, CLIENT_SIDE_DETECION_BASE_URL, C2_DOMAIN_BLOCKLIST_ENDPOINT, PHISHING_DETECTION_BASE_URL, PHISHING_DETECTION_SCAN_ENDPOINT, PHISHING_DETECTION_BULK_SCAN_ENDPOINT, SECURITY_ALERTS_BASE_URL, TOKEN_BULK_SCANNING_ENDPOINT, ADDRESS_SCAN_ENDPOINT, APPROVALS_ENDPOINT, METAMASK_STALELIST_URL, METAMASK_HOTLIST_DIFF_URL, C2_DOMAIN_BLOCKLIST_URL, } from "./PhishingDataService.cjs";
|
|
11
|
+
export { ListKeys, ListNames, phishingListKeyNameMap } from "./types.cjs";
|
|
12
|
+
export type { ListTypes, EthPhishingResponse, C2DomainBlocklistResponse, PhishingStalelist, PhishingListState, HotlistDiff, DataResultWrapper, Hotlist, BulkPhishingDetectionScanResponse, } from "./types.cjs";
|
|
28
13
|
export declare const C2_DOMAIN_BLOCKLIST_REFRESH_INTERVAL: number;
|
|
29
14
|
export declare const HOTLIST_REFRESH_INTERVAL: number;
|
|
30
15
|
export declare const STALELIST_REFRESH_INTERVAL: number;
|
|
31
|
-
export declare const METAMASK_STALELIST_URL = "https://phishing-detection.api.cx.metamask.io/v1/stalelist";
|
|
32
|
-
export declare const METAMASK_HOTLIST_DIFF_URL = "https://phishing-detection.api.cx.metamask.io/v2/diffsSince";
|
|
33
|
-
export declare const C2_DOMAIN_BLOCKLIST_URL = "https://client-side-detection.api.cx.metamask.io/v1/request-blocklist";
|
|
34
|
-
/**
|
|
35
|
-
* @type ListTypes
|
|
36
|
-
*
|
|
37
|
-
* Type outlining the types of lists provided by aggregating different source lists
|
|
38
|
-
*/
|
|
39
|
-
export type ListTypes = 'fuzzylist' | 'blocklist' | 'blocklistPaths' | 'allowlist' | 'c2DomainBlocklist';
|
|
40
|
-
/**
|
|
41
|
-
* @type EthPhishingResponse
|
|
42
|
-
*
|
|
43
|
-
* Configuration response from the eth-phishing-detect package
|
|
44
|
-
* consisting of approved and unapproved website origins
|
|
45
|
-
*
|
|
46
|
-
* @property blacklist - List of unapproved origins
|
|
47
|
-
* @property fuzzylist - List of fuzzy-matched unapproved origins
|
|
48
|
-
* @property tolerance - Fuzzy match tolerance level
|
|
49
|
-
* @property version - Version number of this configuration
|
|
50
|
-
* @property whitelist - List of approved origins
|
|
51
|
-
*/
|
|
52
|
-
export type EthPhishingResponse = {
|
|
53
|
-
blacklist: string[];
|
|
54
|
-
fuzzylist: string[];
|
|
55
|
-
tolerance: number;
|
|
56
|
-
version: number;
|
|
57
|
-
whitelist: string[];
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* @type C2DomainBlocklistResponse
|
|
61
|
-
*
|
|
62
|
-
* Response for blocklist update requests
|
|
63
|
-
*
|
|
64
|
-
* @property recentlyAdded - List of c2 domains recently added to the blocklist
|
|
65
|
-
* @property recentlyRemoved - List of c2 domains recently removed from the blocklist
|
|
66
|
-
* @property lastFetchedAt - Timestamp of the last fetch request
|
|
67
|
-
*/
|
|
68
|
-
export type C2DomainBlocklistResponse = {
|
|
69
|
-
recentlyAdded: string[];
|
|
70
|
-
recentlyRemoved: string[];
|
|
71
|
-
lastFetchedAt: string;
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* PhishingStalelist defines the expected type of the stalelist from the API.
|
|
75
|
-
*
|
|
76
|
-
* allowlist - List of approved origins.
|
|
77
|
-
* blocklist - List of unapproved origins (hostname-only entries).
|
|
78
|
-
* blocklistPaths - Trie of unapproved origins with paths (hostname + path entries).
|
|
79
|
-
* fuzzylist - List of fuzzy-matched unapproved origins.
|
|
80
|
-
* tolerance - Fuzzy match tolerance level
|
|
81
|
-
* lastUpdated - Timestamp of last update.
|
|
82
|
-
* version - Stalelist data structure iteration.
|
|
83
|
-
*/
|
|
84
|
-
export type PhishingStalelist = {
|
|
85
|
-
allowlist: string[];
|
|
86
|
-
blocklist: string[];
|
|
87
|
-
blocklistPaths: string[];
|
|
88
|
-
fuzzylist: string[];
|
|
89
|
-
tolerance: number;
|
|
90
|
-
version: number;
|
|
91
|
-
lastUpdated: number;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* @type PhishingListState
|
|
95
|
-
*
|
|
96
|
-
* type defining the persisted list state. This is the persisted state that is updated frequently with `this.maybeUpdateState()`.
|
|
97
|
-
*
|
|
98
|
-
* @property allowlist - List of approved origins (legacy naming "whitelist")
|
|
99
|
-
* @property blocklist - List of unapproved origins (legacy naming "blacklist")
|
|
100
|
-
* @property blocklistPaths - Trie of unapproved origins with paths (hostname + path, no query params).
|
|
101
|
-
* @property c2DomainBlocklist - List of hashed hostnames that C2 requests are blocked against.
|
|
102
|
-
* @property fuzzylist - List of fuzzy-matched unapproved origins
|
|
103
|
-
* @property tolerance - Fuzzy match tolerance level
|
|
104
|
-
* @property lastUpdated - Timestamp of last update.
|
|
105
|
-
* @property version - Version of the phishing list state.
|
|
106
|
-
* @property name - Name of the list. Used for attribution.
|
|
107
|
-
*/
|
|
108
|
-
export type PhishingListState = {
|
|
109
|
-
allowlist: string[];
|
|
110
|
-
blocklist: string[];
|
|
111
|
-
blocklistPaths: PathTrie;
|
|
112
|
-
c2DomainBlocklist: string[];
|
|
113
|
-
fuzzylist: string[];
|
|
114
|
-
tolerance: number;
|
|
115
|
-
version: number;
|
|
116
|
-
lastUpdated: number;
|
|
117
|
-
name: ListNames;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* @type HotlistDiff
|
|
121
|
-
*
|
|
122
|
-
* type defining the expected type of the diffs in hotlist.json file.
|
|
123
|
-
*
|
|
124
|
-
* @property url - Url of the diff entry.
|
|
125
|
-
* @property timestamp - Timestamp at which the diff was identified.
|
|
126
|
-
* @property targetList - The list name where the diff was identified.
|
|
127
|
-
* @property isRemoval - Was the diff identified a removal type.
|
|
128
|
-
*/
|
|
129
|
-
export type HotlistDiff = {
|
|
130
|
-
url: string;
|
|
131
|
-
timestamp: number;
|
|
132
|
-
targetList: `${ListKeys}.${ListTypes}`;
|
|
133
|
-
isRemoval?: boolean;
|
|
134
|
-
};
|
|
135
|
-
export type DataResultWrapper<T> = {
|
|
136
|
-
data: T;
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
* @type Hotlist
|
|
140
|
-
*
|
|
141
|
-
* Type defining expected hotlist.json file.
|
|
142
|
-
*
|
|
143
|
-
* @property url - Url of the diff entry.
|
|
144
|
-
* @property timestamp - Timestamp at which the diff was identified.
|
|
145
|
-
* @property targetList - The list name where the diff was identified.
|
|
146
|
-
* @property isRemoval - Was the diff identified a removal type.
|
|
147
|
-
*/
|
|
148
|
-
export type Hotlist = HotlistDiff[];
|
|
149
|
-
/**
|
|
150
|
-
* Enum containing upstream data provider source list keys.
|
|
151
|
-
* These are the keys denoting lists consumed by the upstream data provider.
|
|
152
|
-
*/
|
|
153
|
-
export declare enum ListKeys {
|
|
154
|
-
EthPhishingDetectConfig = "eth_phishing_detect_config"
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Enum containing downstream client attribution names.
|
|
158
|
-
*/
|
|
159
|
-
export declare enum ListNames {
|
|
160
|
-
MetaMask = "MetaMask"
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Maps from list key sourced from upstream data
|
|
164
|
-
* provider to downstream client attribution name.
|
|
165
|
-
*/
|
|
166
|
-
export declare const phishingListKeyNameMap: {
|
|
167
|
-
eth_phishing_detect_config: ListNames;
|
|
168
|
-
};
|
|
169
16
|
declare const controllerName = "PhishingController";
|
|
170
17
|
/**
|
|
171
18
|
* @type PhishingControllerState
|
|
@@ -177,9 +24,6 @@ declare const controllerName = "PhishingController";
|
|
|
177
24
|
* hotlistLastFetched - timestamp of the last hotlist fetch
|
|
178
25
|
* stalelistLastFetched - timestamp of the last stalelist fetch
|
|
179
26
|
* c2DomainBlocklistLastFetched - timestamp of the last c2 domain blocklist fetch
|
|
180
|
-
* urlScanCache - cache of URL scan results
|
|
181
|
-
* tokenScanCache - cache of token scan results
|
|
182
|
-
* addressScanCache - cache of address scan results
|
|
183
27
|
*/
|
|
184
28
|
export type PhishingControllerState = {
|
|
185
29
|
phishingLists: PhishingListState[];
|
|
@@ -188,9 +32,6 @@ export type PhishingControllerState = {
|
|
|
188
32
|
hotlistLastFetched: number;
|
|
189
33
|
stalelistLastFetched: number;
|
|
190
34
|
c2DomainBlocklistLastFetched: number;
|
|
191
|
-
urlScanCache: Record<string, CacheEntry<PhishingDetectionScanResult>>;
|
|
192
|
-
tokenScanCache: Record<string, CacheEntry<TokenScanCacheData>>;
|
|
193
|
-
addressScanCache: Record<string, CacheEntry<AddressScanCacheData>>;
|
|
194
35
|
};
|
|
195
36
|
/**
|
|
196
37
|
* PhishingControllerOptions
|
|
@@ -199,23 +40,11 @@ export type PhishingControllerState = {
|
|
|
199
40
|
* stalelistRefreshInterval - Polling interval used to fetch stale list.
|
|
200
41
|
* hotlistRefreshInterval - Polling interval used to fetch hotlist diff list.
|
|
201
42
|
* c2DomainBlocklistRefreshInterval - Polling interval used to fetch c2 domain blocklist.
|
|
202
|
-
* urlScanCacheTTL - Time to live in seconds for cached scan results.
|
|
203
|
-
* urlScanCacheMaxSize - Maximum number of entries in the scan cache.
|
|
204
|
-
* tokenScanCacheTTL - Time to live in seconds for cached token scan results.
|
|
205
|
-
* tokenScanCacheMaxSize - Maximum number of entries in the token scan cache.
|
|
206
|
-
* addressScanCacheTTL - Time to live in seconds for cached address scan results.
|
|
207
|
-
* addressScanCacheMaxSize - Maximum number of entries in the address scan cache.
|
|
208
43
|
*/
|
|
209
44
|
export type PhishingControllerOptions = {
|
|
210
45
|
stalelistRefreshInterval?: number;
|
|
211
46
|
hotlistRefreshInterval?: number;
|
|
212
47
|
c2DomainBlocklistRefreshInterval?: number;
|
|
213
|
-
urlScanCacheTTL?: number;
|
|
214
|
-
urlScanCacheMaxSize?: number;
|
|
215
|
-
tokenScanCacheTTL?: number;
|
|
216
|
-
tokenScanCacheMaxSize?: number;
|
|
217
|
-
addressScanCacheTTL?: number;
|
|
218
|
-
addressScanCacheMaxSize?: number;
|
|
219
48
|
messenger: PhishingControllerMessenger;
|
|
220
49
|
state?: Partial<PhishingControllerState>;
|
|
221
50
|
};
|
|
@@ -234,24 +63,12 @@ export type PhishingControllerEvents = PhishingControllerStateChangeEvent;
|
|
|
234
63
|
/**
|
|
235
64
|
* The external actions available to the PhishingController.
|
|
236
65
|
*/
|
|
237
|
-
type AllowedActions = AddressBookControllerGetStateAction | TransactionControllerGetStateAction;
|
|
66
|
+
type AllowedActions = AddressBookControllerGetStateAction | TransactionControllerGetStateAction | PhishingDataServiceMethodActions;
|
|
238
67
|
/**
|
|
239
68
|
* The external events available to the PhishingController.
|
|
240
69
|
*/
|
|
241
70
|
export type AllowedEvents = AddressBookControllerStateChangeEvent | TransactionControllerStateChangeEvent;
|
|
242
71
|
export type PhishingControllerMessenger = Messenger<typeof controllerName, PhishingControllerActions | AllowedActions, PhishingControllerEvents | AllowedEvents>;
|
|
243
|
-
/**
|
|
244
|
-
* BulkPhishingDetectionScanResponse
|
|
245
|
-
*
|
|
246
|
-
* Response for bulk phishing detection scan requests
|
|
247
|
-
* results - Record of domain names and their corresponding phishing detection scan results
|
|
248
|
-
*
|
|
249
|
-
* errors - Record of domain names and their corresponding errors
|
|
250
|
-
*/
|
|
251
|
-
export type BulkPhishingDetectionScanResponse = {
|
|
252
|
-
results: Record<string, PhishingDetectionScanResult>;
|
|
253
|
-
errors: Record<string, string[]>;
|
|
254
|
-
};
|
|
255
72
|
/**
|
|
256
73
|
* Controller that manages community-maintained lists of approved and unapproved website origins.
|
|
257
74
|
*/
|
|
@@ -264,16 +81,10 @@ export declare class PhishingController extends BaseController<typeof controller
|
|
|
264
81
|
* @param config.stalelistRefreshInterval - Polling interval used to fetch stale list.
|
|
265
82
|
* @param config.hotlistRefreshInterval - Polling interval used to fetch hotlist diff list.
|
|
266
83
|
* @param config.c2DomainBlocklistRefreshInterval - Polling interval used to fetch c2 domain blocklist.
|
|
267
|
-
* @param config.urlScanCacheTTL - Time to live in seconds for cached scan results.
|
|
268
|
-
* @param config.urlScanCacheMaxSize - Maximum number of entries in the scan cache.
|
|
269
|
-
* @param config.tokenScanCacheTTL - Time to live in seconds for cached token scan results.
|
|
270
|
-
* @param config.tokenScanCacheMaxSize - Maximum number of entries in the token scan cache.
|
|
271
|
-
* @param config.addressScanCacheTTL - Time to live in seconds for cached address scan results.
|
|
272
|
-
* @param config.addressScanCacheMaxSize - Maximum number of entries in the address scan cache.
|
|
273
84
|
* @param config.messenger - The controller restricted messenger.
|
|
274
85
|
* @param config.state - Initial state to set on this controller.
|
|
275
86
|
*/
|
|
276
|
-
constructor({ stalelistRefreshInterval, hotlistRefreshInterval, c2DomainBlocklistRefreshInterval,
|
|
87
|
+
constructor({ stalelistRefreshInterval, hotlistRefreshInterval, c2DomainBlocklistRefreshInterval, messenger, state, }: PhishingControllerOptions);
|
|
277
88
|
/**
|
|
278
89
|
* Updates this.detector with an instance of PhishingDetector using the current state.
|
|
279
90
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhishingController.d.cts","sourceRoot":"","sources":["../src/PhishingController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EAEnC,qCAAqC,EACtC,0CAA0C;AAC3C,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAEV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;
|
|
1
|
+
{"version":3,"file":"PhishingController.d.cts","sourceRoot":"","sources":["../src/PhishingController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EAEnC,qCAAqC,EACtC,0CAA0C;AAC3C,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAEV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AAEnC,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AAErD,OAAO,KAAK,EACV,mCAAmC,EAEnC,qCAAqC,EAEtC,yCAAyC;AAc1C,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAsB;AAC9C,OAAO,KAAK,EACV,wCAAwC,EACxC,+BAA+B,EAC/B,kCAAkC,EACnC,qDAAoD;AACrD,OAAO,KAAK,EAAE,gCAAgC,EAAE,sDAAqD;AAUrG,OAAO,KAAK,EACV,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EAEpB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,iCAAiC,EAIjC,iBAAiB,EAElB,oBAAmB;AAepB,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,2BAA2B,EAC3B,gCAAgC,EACh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B;IAc7B;;;;;OAKG;IACG,aAAa;IAcnB;;;;;OAKG;IACG,eAAe;IAcrB;;;;;;;OAOG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAgChE;;;;;;OAMG;IACG,YAAY,CAChB,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CAAC,iCAAiC,CAAC;IA8G7C;;;;;;OAMG;IACG,WAAW,CACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,CAAC;IAwC7B;;;;;;OAMG;IACH,YAAY,YACD,MAAM,WACN,MAAM,KACd,QAAQ,iBAAiB,CAAC,CAyB3B;IAEF;;;;;;;;;;;OAWG;IACG,cAAc,CAClB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;CAkTlC;AAED,eAAe,kBAAkB,CAAC;AAElC,YAAY,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -3,169 +3,16 @@ import { BaseController } from "@metamask/base-controller";
|
|
|
3
3
|
import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller";
|
|
4
4
|
import type { Messenger } from "@metamask/messenger";
|
|
5
5
|
import type { TransactionControllerGetStateAction, TransactionControllerStateChangeEvent } from "@metamask/transaction-controller";
|
|
6
|
-
import type { CacheEntry } from "./CacheManager.mjs";
|
|
7
6
|
import type { PathTrie } from "./PathTrie.mjs";
|
|
8
7
|
import type { PhishingControllerMaybeUpdateStateAction, PhishingControllerMethodActions, PhishingControllerTestOriginAction } from "./PhishingController-method-action-types.mjs";
|
|
9
|
-
import type {
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export declare const C2_DOMAIN_BLOCKLIST_ENDPOINT = "/v1/request-blocklist";
|
|
15
|
-
export declare const PHISHING_DETECTION_BASE_URL = "https://dapp-scanning.api.cx.metamask.io";
|
|
16
|
-
export declare const PHISHING_DETECTION_SCAN_ENDPOINT = "v2/scan";
|
|
17
|
-
export declare const PHISHING_DETECTION_BULK_SCAN_ENDPOINT = "bulk-scan";
|
|
18
|
-
export declare const SECURITY_ALERTS_BASE_URL = "https://security-alerts.api.cx.metamask.io";
|
|
19
|
-
export declare const TOKEN_BULK_SCANNING_ENDPOINT = "/token/scan-bulk";
|
|
20
|
-
export declare const ADDRESS_SCAN_ENDPOINT = "/address/evm/scan";
|
|
21
|
-
export declare const APPROVALS_ENDPOINT = "/address/evm/approvals";
|
|
22
|
-
export declare const DEFAULT_URL_SCAN_CACHE_TTL: number;
|
|
23
|
-
export declare const DEFAULT_URL_SCAN_CACHE_MAX_SIZE = 250;
|
|
24
|
-
export declare const DEFAULT_TOKEN_SCAN_CACHE_TTL: number;
|
|
25
|
-
export declare const DEFAULT_TOKEN_SCAN_CACHE_MAX_SIZE = 1000;
|
|
26
|
-
export declare const DEFAULT_ADDRESS_SCAN_CACHE_TTL: number;
|
|
27
|
-
export declare const DEFAULT_ADDRESS_SCAN_CACHE_MAX_SIZE = 1000;
|
|
8
|
+
import type { PhishingDataServiceMethodActions } from "./PhishingDataService-method-action-types.mjs";
|
|
9
|
+
import type { PhishingDetectorResult, PhishingDetectionScanResult, BulkTokenScanResponse, BulkTokenScanRequest, AddressScanResult, SimilarAddressMatch, ApprovalsResponse, BulkPhishingDetectionScanResponse, PhishingListState } from "./types.mjs";
|
|
10
|
+
export { PHISHING_CONFIG_BASE_URL, METAMASK_STALELIST_FILE, METAMASK_HOTLIST_DIFF_FILE, CLIENT_SIDE_DETECION_BASE_URL, C2_DOMAIN_BLOCKLIST_ENDPOINT, PHISHING_DETECTION_BASE_URL, PHISHING_DETECTION_SCAN_ENDPOINT, PHISHING_DETECTION_BULK_SCAN_ENDPOINT, SECURITY_ALERTS_BASE_URL, TOKEN_BULK_SCANNING_ENDPOINT, ADDRESS_SCAN_ENDPOINT, APPROVALS_ENDPOINT, METAMASK_STALELIST_URL, METAMASK_HOTLIST_DIFF_URL, C2_DOMAIN_BLOCKLIST_URL, } from "./PhishingDataService.mjs";
|
|
11
|
+
export { ListKeys, ListNames, phishingListKeyNameMap } from "./types.mjs";
|
|
12
|
+
export type { ListTypes, EthPhishingResponse, C2DomainBlocklistResponse, PhishingStalelist, PhishingListState, HotlistDiff, DataResultWrapper, Hotlist, BulkPhishingDetectionScanResponse, } from "./types.mjs";
|
|
28
13
|
export declare const C2_DOMAIN_BLOCKLIST_REFRESH_INTERVAL: number;
|
|
29
14
|
export declare const HOTLIST_REFRESH_INTERVAL: number;
|
|
30
15
|
export declare const STALELIST_REFRESH_INTERVAL: number;
|
|
31
|
-
export declare const METAMASK_STALELIST_URL = "https://phishing-detection.api.cx.metamask.io/v1/stalelist";
|
|
32
|
-
export declare const METAMASK_HOTLIST_DIFF_URL = "https://phishing-detection.api.cx.metamask.io/v2/diffsSince";
|
|
33
|
-
export declare const C2_DOMAIN_BLOCKLIST_URL = "https://client-side-detection.api.cx.metamask.io/v1/request-blocklist";
|
|
34
|
-
/**
|
|
35
|
-
* @type ListTypes
|
|
36
|
-
*
|
|
37
|
-
* Type outlining the types of lists provided by aggregating different source lists
|
|
38
|
-
*/
|
|
39
|
-
export type ListTypes = 'fuzzylist' | 'blocklist' | 'blocklistPaths' | 'allowlist' | 'c2DomainBlocklist';
|
|
40
|
-
/**
|
|
41
|
-
* @type EthPhishingResponse
|
|
42
|
-
*
|
|
43
|
-
* Configuration response from the eth-phishing-detect package
|
|
44
|
-
* consisting of approved and unapproved website origins
|
|
45
|
-
*
|
|
46
|
-
* @property blacklist - List of unapproved origins
|
|
47
|
-
* @property fuzzylist - List of fuzzy-matched unapproved origins
|
|
48
|
-
* @property tolerance - Fuzzy match tolerance level
|
|
49
|
-
* @property version - Version number of this configuration
|
|
50
|
-
* @property whitelist - List of approved origins
|
|
51
|
-
*/
|
|
52
|
-
export type EthPhishingResponse = {
|
|
53
|
-
blacklist: string[];
|
|
54
|
-
fuzzylist: string[];
|
|
55
|
-
tolerance: number;
|
|
56
|
-
version: number;
|
|
57
|
-
whitelist: string[];
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* @type C2DomainBlocklistResponse
|
|
61
|
-
*
|
|
62
|
-
* Response for blocklist update requests
|
|
63
|
-
*
|
|
64
|
-
* @property recentlyAdded - List of c2 domains recently added to the blocklist
|
|
65
|
-
* @property recentlyRemoved - List of c2 domains recently removed from the blocklist
|
|
66
|
-
* @property lastFetchedAt - Timestamp of the last fetch request
|
|
67
|
-
*/
|
|
68
|
-
export type C2DomainBlocklistResponse = {
|
|
69
|
-
recentlyAdded: string[];
|
|
70
|
-
recentlyRemoved: string[];
|
|
71
|
-
lastFetchedAt: string;
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* PhishingStalelist defines the expected type of the stalelist from the API.
|
|
75
|
-
*
|
|
76
|
-
* allowlist - List of approved origins.
|
|
77
|
-
* blocklist - List of unapproved origins (hostname-only entries).
|
|
78
|
-
* blocklistPaths - Trie of unapproved origins with paths (hostname + path entries).
|
|
79
|
-
* fuzzylist - List of fuzzy-matched unapproved origins.
|
|
80
|
-
* tolerance - Fuzzy match tolerance level
|
|
81
|
-
* lastUpdated - Timestamp of last update.
|
|
82
|
-
* version - Stalelist data structure iteration.
|
|
83
|
-
*/
|
|
84
|
-
export type PhishingStalelist = {
|
|
85
|
-
allowlist: string[];
|
|
86
|
-
blocklist: string[];
|
|
87
|
-
blocklistPaths: string[];
|
|
88
|
-
fuzzylist: string[];
|
|
89
|
-
tolerance: number;
|
|
90
|
-
version: number;
|
|
91
|
-
lastUpdated: number;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* @type PhishingListState
|
|
95
|
-
*
|
|
96
|
-
* type defining the persisted list state. This is the persisted state that is updated frequently with `this.maybeUpdateState()`.
|
|
97
|
-
*
|
|
98
|
-
* @property allowlist - List of approved origins (legacy naming "whitelist")
|
|
99
|
-
* @property blocklist - List of unapproved origins (legacy naming "blacklist")
|
|
100
|
-
* @property blocklistPaths - Trie of unapproved origins with paths (hostname + path, no query params).
|
|
101
|
-
* @property c2DomainBlocklist - List of hashed hostnames that C2 requests are blocked against.
|
|
102
|
-
* @property fuzzylist - List of fuzzy-matched unapproved origins
|
|
103
|
-
* @property tolerance - Fuzzy match tolerance level
|
|
104
|
-
* @property lastUpdated - Timestamp of last update.
|
|
105
|
-
* @property version - Version of the phishing list state.
|
|
106
|
-
* @property name - Name of the list. Used for attribution.
|
|
107
|
-
*/
|
|
108
|
-
export type PhishingListState = {
|
|
109
|
-
allowlist: string[];
|
|
110
|
-
blocklist: string[];
|
|
111
|
-
blocklistPaths: PathTrie;
|
|
112
|
-
c2DomainBlocklist: string[];
|
|
113
|
-
fuzzylist: string[];
|
|
114
|
-
tolerance: number;
|
|
115
|
-
version: number;
|
|
116
|
-
lastUpdated: number;
|
|
117
|
-
name: ListNames;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* @type HotlistDiff
|
|
121
|
-
*
|
|
122
|
-
* type defining the expected type of the diffs in hotlist.json file.
|
|
123
|
-
*
|
|
124
|
-
* @property url - Url of the diff entry.
|
|
125
|
-
* @property timestamp - Timestamp at which the diff was identified.
|
|
126
|
-
* @property targetList - The list name where the diff was identified.
|
|
127
|
-
* @property isRemoval - Was the diff identified a removal type.
|
|
128
|
-
*/
|
|
129
|
-
export type HotlistDiff = {
|
|
130
|
-
url: string;
|
|
131
|
-
timestamp: number;
|
|
132
|
-
targetList: `${ListKeys}.${ListTypes}`;
|
|
133
|
-
isRemoval?: boolean;
|
|
134
|
-
};
|
|
135
|
-
export type DataResultWrapper<T> = {
|
|
136
|
-
data: T;
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
* @type Hotlist
|
|
140
|
-
*
|
|
141
|
-
* Type defining expected hotlist.json file.
|
|
142
|
-
*
|
|
143
|
-
* @property url - Url of the diff entry.
|
|
144
|
-
* @property timestamp - Timestamp at which the diff was identified.
|
|
145
|
-
* @property targetList - The list name where the diff was identified.
|
|
146
|
-
* @property isRemoval - Was the diff identified a removal type.
|
|
147
|
-
*/
|
|
148
|
-
export type Hotlist = HotlistDiff[];
|
|
149
|
-
/**
|
|
150
|
-
* Enum containing upstream data provider source list keys.
|
|
151
|
-
* These are the keys denoting lists consumed by the upstream data provider.
|
|
152
|
-
*/
|
|
153
|
-
export declare enum ListKeys {
|
|
154
|
-
EthPhishingDetectConfig = "eth_phishing_detect_config"
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Enum containing downstream client attribution names.
|
|
158
|
-
*/
|
|
159
|
-
export declare enum ListNames {
|
|
160
|
-
MetaMask = "MetaMask"
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Maps from list key sourced from upstream data
|
|
164
|
-
* provider to downstream client attribution name.
|
|
165
|
-
*/
|
|
166
|
-
export declare const phishingListKeyNameMap: {
|
|
167
|
-
eth_phishing_detect_config: ListNames;
|
|
168
|
-
};
|
|
169
16
|
declare const controllerName = "PhishingController";
|
|
170
17
|
/**
|
|
171
18
|
* @type PhishingControllerState
|
|
@@ -177,9 +24,6 @@ declare const controllerName = "PhishingController";
|
|
|
177
24
|
* hotlistLastFetched - timestamp of the last hotlist fetch
|
|
178
25
|
* stalelistLastFetched - timestamp of the last stalelist fetch
|
|
179
26
|
* c2DomainBlocklistLastFetched - timestamp of the last c2 domain blocklist fetch
|
|
180
|
-
* urlScanCache - cache of URL scan results
|
|
181
|
-
* tokenScanCache - cache of token scan results
|
|
182
|
-
* addressScanCache - cache of address scan results
|
|
183
27
|
*/
|
|
184
28
|
export type PhishingControllerState = {
|
|
185
29
|
phishingLists: PhishingListState[];
|
|
@@ -188,9 +32,6 @@ export type PhishingControllerState = {
|
|
|
188
32
|
hotlistLastFetched: number;
|
|
189
33
|
stalelistLastFetched: number;
|
|
190
34
|
c2DomainBlocklistLastFetched: number;
|
|
191
|
-
urlScanCache: Record<string, CacheEntry<PhishingDetectionScanResult>>;
|
|
192
|
-
tokenScanCache: Record<string, CacheEntry<TokenScanCacheData>>;
|
|
193
|
-
addressScanCache: Record<string, CacheEntry<AddressScanCacheData>>;
|
|
194
35
|
};
|
|
195
36
|
/**
|
|
196
37
|
* PhishingControllerOptions
|
|
@@ -199,23 +40,11 @@ export type PhishingControllerState = {
|
|
|
199
40
|
* stalelistRefreshInterval - Polling interval used to fetch stale list.
|
|
200
41
|
* hotlistRefreshInterval - Polling interval used to fetch hotlist diff list.
|
|
201
42
|
* c2DomainBlocklistRefreshInterval - Polling interval used to fetch c2 domain blocklist.
|
|
202
|
-
* urlScanCacheTTL - Time to live in seconds for cached scan results.
|
|
203
|
-
* urlScanCacheMaxSize - Maximum number of entries in the scan cache.
|
|
204
|
-
* tokenScanCacheTTL - Time to live in seconds for cached token scan results.
|
|
205
|
-
* tokenScanCacheMaxSize - Maximum number of entries in the token scan cache.
|
|
206
|
-
* addressScanCacheTTL - Time to live in seconds for cached address scan results.
|
|
207
|
-
* addressScanCacheMaxSize - Maximum number of entries in the address scan cache.
|
|
208
43
|
*/
|
|
209
44
|
export type PhishingControllerOptions = {
|
|
210
45
|
stalelistRefreshInterval?: number;
|
|
211
46
|
hotlistRefreshInterval?: number;
|
|
212
47
|
c2DomainBlocklistRefreshInterval?: number;
|
|
213
|
-
urlScanCacheTTL?: number;
|
|
214
|
-
urlScanCacheMaxSize?: number;
|
|
215
|
-
tokenScanCacheTTL?: number;
|
|
216
|
-
tokenScanCacheMaxSize?: number;
|
|
217
|
-
addressScanCacheTTL?: number;
|
|
218
|
-
addressScanCacheMaxSize?: number;
|
|
219
48
|
messenger: PhishingControllerMessenger;
|
|
220
49
|
state?: Partial<PhishingControllerState>;
|
|
221
50
|
};
|
|
@@ -234,24 +63,12 @@ export type PhishingControllerEvents = PhishingControllerStateChangeEvent;
|
|
|
234
63
|
/**
|
|
235
64
|
* The external actions available to the PhishingController.
|
|
236
65
|
*/
|
|
237
|
-
type AllowedActions = AddressBookControllerGetStateAction | TransactionControllerGetStateAction;
|
|
66
|
+
type AllowedActions = AddressBookControllerGetStateAction | TransactionControllerGetStateAction | PhishingDataServiceMethodActions;
|
|
238
67
|
/**
|
|
239
68
|
* The external events available to the PhishingController.
|
|
240
69
|
*/
|
|
241
70
|
export type AllowedEvents = AddressBookControllerStateChangeEvent | TransactionControllerStateChangeEvent;
|
|
242
71
|
export type PhishingControllerMessenger = Messenger<typeof controllerName, PhishingControllerActions | AllowedActions, PhishingControllerEvents | AllowedEvents>;
|
|
243
|
-
/**
|
|
244
|
-
* BulkPhishingDetectionScanResponse
|
|
245
|
-
*
|
|
246
|
-
* Response for bulk phishing detection scan requests
|
|
247
|
-
* results - Record of domain names and their corresponding phishing detection scan results
|
|
248
|
-
*
|
|
249
|
-
* errors - Record of domain names and their corresponding errors
|
|
250
|
-
*/
|
|
251
|
-
export type BulkPhishingDetectionScanResponse = {
|
|
252
|
-
results: Record<string, PhishingDetectionScanResult>;
|
|
253
|
-
errors: Record<string, string[]>;
|
|
254
|
-
};
|
|
255
72
|
/**
|
|
256
73
|
* Controller that manages community-maintained lists of approved and unapproved website origins.
|
|
257
74
|
*/
|
|
@@ -264,16 +81,10 @@ export declare class PhishingController extends BaseController<typeof controller
|
|
|
264
81
|
* @param config.stalelistRefreshInterval - Polling interval used to fetch stale list.
|
|
265
82
|
* @param config.hotlistRefreshInterval - Polling interval used to fetch hotlist diff list.
|
|
266
83
|
* @param config.c2DomainBlocklistRefreshInterval - Polling interval used to fetch c2 domain blocklist.
|
|
267
|
-
* @param config.urlScanCacheTTL - Time to live in seconds for cached scan results.
|
|
268
|
-
* @param config.urlScanCacheMaxSize - Maximum number of entries in the scan cache.
|
|
269
|
-
* @param config.tokenScanCacheTTL - Time to live in seconds for cached token scan results.
|
|
270
|
-
* @param config.tokenScanCacheMaxSize - Maximum number of entries in the token scan cache.
|
|
271
|
-
* @param config.addressScanCacheTTL - Time to live in seconds for cached address scan results.
|
|
272
|
-
* @param config.addressScanCacheMaxSize - Maximum number of entries in the address scan cache.
|
|
273
84
|
* @param config.messenger - The controller restricted messenger.
|
|
274
85
|
* @param config.state - Initial state to set on this controller.
|
|
275
86
|
*/
|
|
276
|
-
constructor({ stalelistRefreshInterval, hotlistRefreshInterval, c2DomainBlocklistRefreshInterval,
|
|
87
|
+
constructor({ stalelistRefreshInterval, hotlistRefreshInterval, c2DomainBlocklistRefreshInterval, messenger, state, }: PhishingControllerOptions);
|
|
277
88
|
/**
|
|
278
89
|
* Updates this.detector with an instance of PhishingDetector using the current state.
|
|
279
90
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhishingController.d.mts","sourceRoot":"","sources":["../src/PhishingController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EAEnC,qCAAqC,EACtC,0CAA0C;AAC3C,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAEV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;
|
|
1
|
+
{"version":3,"file":"PhishingController.d.mts","sourceRoot":"","sources":["../src/PhishingController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EAEnC,qCAAqC,EACtC,0CAA0C;AAC3C,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAEV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AAEnC,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AAErD,OAAO,KAAK,EACV,mCAAmC,EAEnC,qCAAqC,EAEtC,yCAAyC;AAc1C,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAsB;AAC9C,OAAO,KAAK,EACV,wCAAwC,EACxC,+BAA+B,EAC/B,kCAAkC,EACnC,qDAAoD;AACrD,OAAO,KAAK,EAAE,gCAAgC,EAAE,sDAAqD;AAUrG,OAAO,KAAK,EACV,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EAEpB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,iCA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