Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/phishing-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add `extractSignatureAddresses` utility, plus `ExtractedSignatureAddresses` and `ExtractSignatureAddressesOptions` types, to collect the `address`-typed values from an EIP-712 typed-data message for real-time address scanning ([#10170](https://github.com/MetaMask/core/pull/10170))
- Walks the `types` schema from `primaryType`, matching fields by declared type (`address`/`address[]`, including nested structs and arrays) rather than by field name, so custom and unknown message shapes are covered without per-protocol handling.
- Normalizes non-canonical `address` encodings (variable-length hex and decimal strings) into canonical lower-case 20-byte hex by taking the leading 20 bytes of the signer-compatible big-endian encoding, and de-duplicates case-insensitively.
- Excludes the zero address, a caller-provided `exclude` list (e.g. the signer), and caller-provided top-level `excludeFields`.
- Bounds work with a distinct-address cap (default 10, caller-overridable via `maxAddresses`, hard ceiling 50), a traversal depth limit, and a node budget, reporting `overflow` when the message could not be fully walked. Exports `DEFAULT_MAX_SIGNATURE_ADDRESSES` and `MAX_SIGNATURE_ADDRESSES_CEILING`.
- Returns the field name each address was found under so callers can attribute alerts.

## [18.0.0]

### Changed
Expand Down
1 change: 1 addition & 0 deletions packages/phishing-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
},
"devDependencies": {
"@metamask/auto-changelog": "^6.1.0",
"@metamask/eth-sig-util": "^9.0.0",
"@types/jest": "^30.0.0",
"@typescript/native": "npm:typescript@^7.0.2",
"deepmerge": "^4.2.2",
Expand Down
9 changes: 9 additions & 0 deletions packages/phishing-controller/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ export {
isAddressScanSupportedChainId,
isPhishingDetectionPathBasedHostname,
} from './utils.js';
export {
extractSignatureAddresses,
DEFAULT_MAX_SIGNATURE_ADDRESSES,
MAX_SIGNATURE_ADDRESSES_CEILING,
} from './signature-address-extraction.js';
export type {
ExtractedSignatureAddresses,
ExtractSignatureAddressesOptions,
} from './signature-address-extraction.js';

export type {
PhishingControllerMaybeUpdateStateAction,
Expand Down
Loading