Skip to content

Commit 568232d

Browse files
committed
Merge remote-tracking branch 'origin/main' into sync-v14-main
* origin/main: fix: change types signatures verifyingContract validation to allow 'cosmos' as address (#334) Update `main` with changes from v14.0.1 (#332) Request validation should not throw if verifyingContract is not defined in typed signature (#328) Add changelog entries for `#318` (#327) remove eth_sign (#320)
2 parents 48218dc + 7fbac8b commit 568232d

File tree

2 files changed

+6
-36
lines changed

2 files changed

+6
-36
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
- Bump `@metamask/rpc-errors` from `^6.0.0` to `^6.3.1` ([#323](https://github.com/MetaMask/eth-json-rpc-middleware/pull/323))
2727
- Bump `@metamask/utils` from `^8.1.0` to `^9.1.0` ([#323](https://github.com/MetaMask/eth-json-rpc-middleware/pull/323))
2828

29+
### Security
30+
- **BREAKING:** Typed signature validation only replaces `0X` prefix with `0x`, and contract address normalization is removed for decimal and octal values ([#318](https://github.com/MetaMask/eth-json-rpc-middleware/pull/318))
31+
- Threat actors have been manipulating `eth_signTypedData_v4` fields to cause failures in blockaid's detectors.
32+
- Extension crashes with an error when performing Malicious permit with a non-0x prefixed integer address.
33+
- This fixes an issue where the key value row or petname component disappears if a signed address is prefixed by "0X" instead of "0x".
34+
2935
## [13.0.0]
3036
### Changed
3137
- **BREAKING**: Drop support for Node.js v16; add support for Node.js v20, v22 ([#312](https://github.com/MetaMask/eth-json-rpc-middleware/pull/312))

src/wallet.ts

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ export interface WalletMiddlewareOptions {
5555
address: string,
5656
req: JsonRpcRequest,
5757
) => Promise<string>;
58-
processEthSignMessage?: (
59-
msgParams: MessageParams,
60-
req: JsonRpcRequest,
61-
) => Promise<string>;
6258
processPersonalMessage?: (
6359
msgParams: MessageParams,
6460
req: JsonRpcRequest,
@@ -92,7 +88,6 @@ export function createWalletMiddleware({
9288
getAccounts,
9389
processDecryptMessage,
9490
processEncryptionPublicKey,
95-
processEthSignMessage,
9691
processPersonalMessage,
9792
processTransaction,
9893
processSignTransaction,
@@ -113,7 +108,6 @@ WalletMiddlewareOptions): JsonRpcMiddleware<any, Block> {
113108
eth_sendTransaction: createAsyncMiddleware(sendTransaction),
114109
eth_signTransaction: createAsyncMiddleware(signTransaction),
115110
// message signatures
116-
eth_sign: createAsyncMiddleware(ethSign),
117111
eth_signTypedData: createAsyncMiddleware(signTypedData),
118112
eth_signTypedData_v3: createAsyncMiddleware(signTypedDataV3),
119113
eth_signTypedData_v4: createAsyncMiddleware(signTypedDataV4),
@@ -195,36 +189,6 @@ WalletMiddlewareOptions): JsonRpcMiddleware<any, Block> {
195189
//
196190
// message signatures
197191
//
198-
199-
async function ethSign(
200-
req: JsonRpcRequest,
201-
res: PendingJsonRpcResponse<Json>,
202-
): Promise<void> {
203-
if (!processEthSignMessage) {
204-
throw rpcErrors.methodNotSupported();
205-
}
206-
if (
207-
!req?.params ||
208-
!Array.isArray(req.params) ||
209-
!(req.params.length >= 2)
210-
) {
211-
throw rpcErrors.invalidInput();
212-
}
213-
214-
const params = req.params as [string, string, Record<string, string>?];
215-
const address: string = await validateAndNormalizeKeyholder(params[0], req);
216-
const message = params[1];
217-
const extraParams = params[2] || {};
218-
const msgParams: MessageParams = {
219-
...extraParams,
220-
from: address,
221-
data: message,
222-
signatureMethod: 'eth_sign',
223-
};
224-
225-
res.result = await processEthSignMessage(msgParams, req);
226-
}
227-
228192
async function signTypedData(
229193
req: JsonRpcRequest,
230194
res: PendingJsonRpcResponse<Json>,

0 commit comments

Comments
 (0)