Skip to content

feat: hardware wallet emulators - #560

Open
montelaidev wants to merge 84 commits into
mainfrom
feat/speculos-packages
Open

montelaidev wants to merge 84 commits into
mainfrom
feat/speculos-packages

Conversation

@montelaidev

@montelaidev montelaidev commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

This PR introduces hardware wallet emulators to be used in clients for e2e testing. In this initial release, it only includes the ledger speculos emulator

Examples


Note

Medium Risk
Large new E2E stack (HID/APDU bridge, signing flow timing, Docker/process lifecycle) affects how Ledger flows are tested but does not change production keyring or auth code paths.

Overview
Adds Ledger Speculos–based hardware wallet emulation for client E2E tests via two new packages and release tooling.

@metamask/hw-emulator exposes createEmulator() with Docker (default off Linux) and native Linux modes, bundled Ethereum ELF apps and NVRAM, SpeculosClient / DockerManager / ProcessManager, screen automation for Nano and touch devices, and an ApduBridge plus injectable WebHID mock script so browser tests can talk to Speculos without real devices. Native start can resolve the Speculos binary through optional @metamask/speculos-up. Docker compose wiring now honors custom ports, seed, and display via env vars.

@metamask/speculos-up installs managed Linux Speculos binaries (bundled archives with SHA-256 checks, GitHub release fallback, cache, mm-speculos-up CLI). Maintainers get build-speculos.yml (tag speculos-v*) and local Docker/native build scripts for linux-amd64/arm64 archives.

The monorepo README, root TypeScript project references, and .gitignore (dist-build/, .worktrees/) are updated to include the new packages.

Reviewed by Cursor Bugbot for commit de887b2. Bugbot is set up for automated code reviews on this repo. Configure here.

…ages

- @metamask/speculos: Speculos emulator lifecycle, transport, and device interaction
  - Speculos class with start/stop lifecycle (auto-detect Docker vs native)
  - SpeculosClient for TCP APDU and REST API communication
  - ApduBridge WebSocket HID relay for browser E2E testing
  - DockerManager and ProcessManager for container/native binary lifecycle
  - DeviceInteraction handlers for button (Nano) and touch (Stax/Flex)
  - WebHID mock script for browser injection
  - Bundled ELF apps (nanosp, nanox, stax, flex), NVRAM, docker-compose.yml

- @metamask/speculos-up: Binary downloader for native Speculos
  - ensureBinary() with SHA-256 checksum verification
  - Platform detection (linux-x64, linux-arm64, darwin-arm64)
  - CLI entry point for standalone setup
- Add explicit return types to all arrow functions and callbacks
- Replace negated conditions with positive equivalents
- Fix JSDoc param names and descriptions for fingerTap/fingerSwipe/connectWithResilience
- Replace void IIFEs with proper async method extraction (apdu-bridge #handleMessage)
- Use nullish coalescing assignment (??=) where appropriate
- Wrap async callbacks in void-safe wrappers for setTimeout (no-misused-promises)
- Replace resolves.toBeUndefined patterns with direct await + assertion
- Add toThrow messages and increase timeouts for delay-based tests
- Use type assertions instead of non-null assertions for Record lookups
- Remove unused imports and suppress inherent Node.js rule violations in tests
- Prune eslint-suppressions.json to only permanent suppressions
@montelaidev montelaidev self-assigned this May 28, 2026
@montelaidev
montelaidev requested a review from a team as a code owner May 28, 2026 13:26
@socket-security

socket-security Bot commented May 28, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​aiohttp@​3.14.37425100100100
Updatednpm/​tar@​7.5.22 ⏵ 7.5.24972599 +196100
Updatednpm/​@​lavamoat/​preinstall-always-fail@​3.0.1 ⏵ 3.0.2811004891 +2100
Addednpm/​jest@​30.5.21001006988100
Addednpm/​@​zxing/​library@​0.23.0881001009070
Addedpypi/​grpcio@​1.86.07210010010070
Updatednpm/​@​ethereumjs/​tx@​10.0.0 ⏵ 10.1.3100 +210010087 -470
Updatednpm/​@​ethereumjs/​rlp@​10.0.0 ⏵ 10.1.3100100100 +487 -370
Updatednpm/​@​ethereumjs/​util@​10.0.0 ⏵ 10.1.310010010087 -370
Updatednpm/​@​types/​secp256k1@​4.0.6 ⏵ 4.0.71001007180100
Updatednpm/​@​types/​ws@​8.18.1 ⏵ 8.18.2100 +110073 +181100
Updatednpm/​@​types/​semver@​7.7.1 ⏵ 7.8.010010074 +181100
Addednpm/​@​keystonehq/​bc-ur-registry-eth@​0.23.21001007590100
Addednpm/​@​types/​jest@​30.0.01001007680100
Updatednpm/​@​metamask/​eth-sig-util@​10.0.0 ⏵ 10.0.1100 +110078 +193 +3100
Updatednpm/​@​ts-bridge/​cli@​0.6.3 ⏵ 0.6.483 +110080 +181100
Updatednpm/​deepmerge@​4.2.2 ⏵ 4.3.1100 +110010080100
Addednpm/​qrcode-generator@​2.0.410010010080100
Addednpm/​@​types/​node@​26.6.111001008195100
Addednpm/​tsd@​0.33.010010010082100
Addednpm/​rimraf@​6.1.410010010084100
Addednpm/​jest-it-up@​5.0.1861009289100
Addedpypi/​pytest@​9.2.086100100100100
Updatednpm/​@​ethereumjs/​common@​10.0.0 ⏵ 10.1.310010010087 -3100
Addednpm/​typedoc@​0.28.201001009788100
Updatednpm/​ts-jest@​29.2.5 ⏵ 29.4.159710095 +289100
Addednpm/​typescript@​5.9.31001009010090
Updatednpm/​secp256k1@​4.0.3 ⏵ 5.0.2100 +1100 +1610091 +9100
Updatednpm/​@​lavamoat/​allow-scripts@​5.1.0 ⏵ 5.1.19910010092 -1100
Addedpypi/​bumble@​0.0.23393100100100100
Updatednpm/​ws@​8.22.0 ⏵ 8.23.199100 +1610095100
Addedpypi/​hatchling@​1.33.096100100100100
Addedpypi/​click@​8.4.296100100100100
See 3 more rows in the dashboard

View full report

@socket-security

socket-security Bot commented May 28, 2026 •

Copy link
Copy Markdown

Caution

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Priority Alert  (click "▶" to expand/collapse) Action
Critical priority
Critical CVE: npm cipher-base is missing type checks, leading to hash rewind and passing on crafted data

CVE: GHSA-cpq7-6gpm-g9rc cipher-base is missing type checks, leading to hash rewind and passing on crafted data (CRITICAL)

Affected versions: < 1.0.5

Patched version: 1.0.5

From: packages/hw-emulator/package.json → npm/@keystonehq/bc-ur-registry-eth@0.23.2 → npm/@metamask/bip39@4.0.0 → npm/@metamask/eth-hd-keyring@4.0.2 → npm/@trezor/connect-web@9.6.1 → npm/ethereumjs-tx@1.3.7 → npm/@keystonehq/bc-ur-registry-eth@0.19.1 → npm/hdkey@2.1.0 → npm/cipher-base@1.0.4

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/cipher-base@1.0.4. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
Critical priority
Critical CVE: npm sha.js is missing type checks leading to hash rewind and passing on crafted data

CVE: GHSA-95m3-7q98-8xr5 sha.js is missing type checks leading to hash rewind and passing on crafted data (CRITICAL)

Affected versions: >= 0.0.0 < 2.4.7; >= 2.4.8 < 2.4.12

Patched version: 2.4.12

From: packages/hw-emulator/package.json → npm/@keystonehq/bc-ur-registry-eth@0.23.2 → npm/@ngraveio/bc-ur@1.1.13 → npm/@metamask/bip39@4.0.0 → npm/@metamask/eth-hd-keyring@4.0.2 → npm/@trezor/connect-web@9.6.1 → npm/ethereumjs-tx@1.3.7 → npm/@keystonehq/bc-ur-registry-eth@0.19.1 → npm/hdkey@2.1.0 → npm/sha.js@2.4.11

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/sha.js@2.4.11. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: npm brace-expansion: DoS via exponential-time expansion of consecutive non-expanding {} groups

CVE: GHSA-3jxr-9vmj-r5cp brace-expansion: DoS via exponential-time expansion of consecutive non-expanding {} groups (HIGH)

Affected versions: < 1.1.16; >= 2.0.0 < 2.1.2; >= 3.0.0 < 5.0.7

Patched version: 1.1.16

From: package.json → npm/eslint@9.39.4 → npm/@metamask/create-release-branch@4.2.1 → npm/secp256k1@5.0.2 → npm/jest@30.5.2 → npm/ts-jest@29.4.15 → npm/depcheck@1.4.7 → npm/@ledgerhq/hw-app-eth@6.42.2 → npm/@metamask/eth-hd-keyring@4.0.2 → npm/@trezor/connect-web@9.6.1 → npm/ethereumjs-tx@1.3.7 → npm/hdkey@2.1.0 → npm/jest@29.7.0 → npm/brace-expansion@1.1.11

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/brace-expansion@1.1.11. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: npm brace-expansion: DoS via uncontrolled recursion on nested brace groups causing stack exhaustion

CVE: GHSA-qhr7-859c-m2p7 brace-expansion: DoS via uncontrolled recursion on nested brace groups causing stack exhaustion (HIGH)

Affected versions: < 1.1.20; >= 2.0.0 < 2.1.6; >= 3.0.0 < 3.0.8; >= 4.0.0 < 5.0.11

Patched version: 1.1.20

From: package.json → npm/eslint@9.39.4 → npm/@metamask/create-release-branch@4.2.1 → npm/secp256k1@5.0.2 → npm/jest@30.5.2 → npm/ts-jest@29.4.15 → npm/depcheck@1.4.7 → npm/@ledgerhq/hw-app-eth@6.42.2 → npm/@metamask/eth-hd-keyring@4.0.2 → npm/@trezor/connect-web@9.6.1 → npm/ethereumjs-tx@1.3.7 → npm/hdkey@2.1.0 → npm/jest@29.7.0 → npm/brace-expansion@1.1.11

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/brace-expansion@1.1.11. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: npm brace-expansion: DoS via uncontrolled recursion in parseCommaParts causing stack exhaustion

CVE: GHSA-6j4f-fj2g-mc7p brace-expansion: DoS via uncontrolled recursion in parseCommaParts causing stack exhaustion (HIGH)

Affected versions: < 1.1.19; >= 2.0.0 < 2.1.5; >= 3.0.0 < 3.0.7; >= 4.0.0 < 5.0.10

Patched version: 1.1.19

From: package.json → npm/eslint@9.39.4 → npm/@metamask/create-release-branch@4.2.1 → npm/secp256k1@5.0.2 → npm/jest@30.5.2 → npm/ts-jest@29.4.15 → npm/depcheck@1.4.7 → npm/@ledgerhq/hw-app-eth@6.42.2 → npm/@metamask/eth-hd-keyring@4.0.2 → npm/@trezor/connect-web@9.6.1 → npm/ethereumjs-tx@1.3.7 → npm/hdkey@2.1.0 → npm/jest@29.7.0 → npm/brace-expansion@1.1.11

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/brace-expansion@1.1.11. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: npm brace-expansion: DoS via unbounded intermediate arrays, bypassing the CVE-2026-14257 mitigation

CVE: GHSA-rgw5-rvv9-x895 brace-expansion: DoS via unbounded intermediate arrays, bypassing the CVE-2026-14257 mitigation (HIGH)

Affected versions: < 1.1.18; >= 2.0.0 < 2.1.4; >= 3.0.0 < 3.0.6; >= 4.0.0 < 5.0.9

Patched version: 1.1.18

From: package.json → npm/eslint@9.39.4 → npm/@metamask/create-release-branch@4.2.1 → npm/secp256k1@5.0.2 → npm/jest@30.5.2 → npm/ts-jest@29.4.15 → npm/depcheck@1.4.7 → npm/@ledgerhq/hw-app-eth@6.42.2 → npm/@metamask/eth-hd-keyring@4.0.2 → npm/@trezor/connect-web@9.6.1 → npm/ethereumjs-tx@1.3.7 → npm/hdkey@2.1.0 → npm/jest@29.7.0 → npm/brace-expansion@1.1.11

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/brace-expansion@1.1.11. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: npm brace-expansion: DoS via unbounded expansion length causing an out-of-memory process crash

CVE: GHSA-mh99-v99m-4gvg brace-expansion: DoS via unbounded expansion length causing an out-of-memory process crash (HIGH)

Affected versions: < 1.1.17; >= 2.0.0 < 2.1.3; >= 3.0.0 < 3.0.3; >= 4.0.0 < 5.0.8

Patched version: 1.1.17

From: package.json → npm/eslint@9.39.4 → npm/@metamask/create-release-branch@4.2.1 → npm/secp256k1@5.0.2 → npm/jest@30.5.2 → npm/ts-jest@29.4.15 → npm/depcheck@1.4.7 → npm/@ledgerhq/hw-app-eth@6.42.2 → npm/@metamask/eth-hd-keyring@4.0.2 → npm/@trezor/connect-web@9.6.1 → npm/ethereumjs-tx@1.3.7 → npm/hdkey@2.1.0 → npm/jest@29.7.0 → npm/brace-expansion@1.1.11

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/brace-expansion@1.1.11. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: npm minimatch has ReDoS: matchOne() combinatorial backtracking via multiple non-adjacent GLOBSTAR segments

CVE: GHSA-7r86-cg39-jmmj minimatch has ReDoS: matchOne() combinatorial backtracking via multiple non-adjacent GLOBSTAR segments (HIGH)

Affected versions: >= 0.1.1 < 3.1.3; >= 4.0.0 < 4.2.5; >= 5.0.0 < 5.1.8; >= 6.0.0 < 6.2.2; >= 7.0.0 < 7.4.8; >= 8.0.0 < 8.0.6; >= 9.0.0 < 9.0.7; >= 10.0.0 < 10.2.3

Patched version: 5.1.8

From: package.json → npm/secp256k1@5.0.2 → npm/jest@30.5.2 → npm/ts-jest@29.4.15 → npm/@ledgerhq/hw-app-eth@6.42.2 → npm/@metamask/eth-hd-keyring@4.0.2 → npm/@trezor/connect-web@9.6.1 → npm/ethereumjs-tx@1.3.7 → npm/hdkey@2.1.0 → npm/jest@29.7.0 → npm/minimatch@5.1.0

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/minimatch@5.1.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: npm minimatch has a ReDoS via repeated wildcards with non-matching literal in pattern

CVE: GHSA-3ppc-4f35-3m26 minimatch has a ReDoS via repeated wildcards with non-matching literal in pattern (HIGH)

Affected versions: >= 0.0.1 < 3.1.3; >= 4.0.0 < 4.2.4; >= 5.0.0 < 5.1.7; >= 6.0.0 < 6.2.1; >= 7.0.0 < 7.4.7; >= 8.0.0 < 8.0.5; >= 9.0.0 < 9.0.6; >= 10.0.0 < 10.2.1

Patched version: 5.1.7

From: package.json → npm/secp256k1@5.0.2 → npm/jest@30.5.2 → npm/ts-jest@29.4.15 → npm/@ledgerhq/hw-app-eth@6.42.2 → npm/@metamask/eth-hd-keyring@4.0.2 → npm/@trezor/connect-web@9.6.1 → npm/ethereumjs-tx@1.3.7 → npm/hdkey@2.1.0 → npm/jest@29.7.0 → npm/minimatch@5.1.0

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/minimatch@5.1.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: npm minimatch ReDoS: nested *() extglobs generate catastrophically backtracking regular expressions

CVE: GHSA-23c5-xmqv-rm74 minimatch ReDoS: nested *() extglobs generate catastrophically backtracking regular expressions (HIGH)

Affected versions: < 3.1.4; >= 4.0.0 < 4.2.5; >= 5.0.0 < 5.1.8; >= 6.0.0 < 6.2.2; >= 7.0.0 < 7.4.8; >= 8.0.0 < 8.0.6; >= 9.0.0 < 9.0.7; >= 10.0.0 < 10.2.3

Patched version: 5.1.8

From: package.json → npm/secp256k1@5.0.2 → npm/jest@30.5.2 → npm/ts-jest@29.4.15 → npm/@ledgerhq/hw-app-eth@6.42.2 → npm/@metamask/eth-hd-keyring@4.0.2 → npm/@trezor/connect-web@9.6.1 → npm/ethereumjs-tx@1.3.7 → npm/hdkey@2.1.0 → npm/jest@29.7.0 → npm/minimatch@5.1.0

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/minimatch@5.1.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: npm nanoid: Integer Overflow or Wraparound

CVE: GHSA-xwg4-73v4-xw9w nanoid: Integer Overflow or Wraparound (HIGH)

Affected versions: < 3.3.12; >= 4.0.0 < 5.1.11

Patched version: 3.3.12

From: package.json → npm/@metamask/snaps-controllers@19.0.1 → npm/@metamask/snaps-utils@12.2.1 → npm/depcheck@1.4.7 → npm/nanoid@3.3.11

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/nanoid@3.3.11. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: AIOHTTP: File descriptor exhaustion in multipart requests

CVE: GHSA-9xw5-w5jj-pvcg AIOHTTP: File descriptor exhaustion in multipart requests (HIGH)

Affected versions: >= 2.0.0 < 3.14.4

Patched version: 3.14.4

From: packages/hw-emulator/pyproject.toml → pypi/aiohttp@3.14.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/aiohttp@3.14.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: pypi aiohttp server lacks an initial request/header timeout

CVE: GHSA-5wr8-gcqf-gqf3 aiohttp server lacks an initial request/header timeout (HIGH)

Affected versions: < 3.14.4

Patched version: 3.14.4

From: packages/hw-emulator/pyproject.toml → pypi/aiohttp@3.14.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/aiohttp@3.14.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: pypi aiohttp: Multiple instances of excessive or unbounded memory/CPU use

CVE: GHSA-2g87-pp6c-29x5 aiohttp: Multiple instances of excessive or unbounded memory/CPU use (HIGH)

Affected versions: < 3.14.4

Patched version: 3.14.4

From: packages/hw-emulator/pyproject.toml → pypi/aiohttp@3.14.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/aiohttp@3.14.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: AIOHTTP: Event loop stall in add_domain() wildcard matching

CVE: GHSA-jm3w-gw2p-xjfj AIOHTTP: Event loop stall in add_domain() wildcard matching (HIGH)

Affected versions: < 3.14.4

Patched version: 3.14.4

From: packages/hw-emulator/pyproject.toml → pypi/aiohttp@3.14.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/aiohttp@3.14.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: AIOHTTP: Too many URL-encoded form fields block the event loop

CVE: GHSA-xgw8-8ccx-rmqh AIOHTTP: Too many URL-encoded form fields block the event loop (HIGH)

Affected versions: < 3.14.4

Patched version: 3.14.4

From: packages/hw-emulator/pyproject.toml → pypi/aiohttp@3.14.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/aiohttp@3.14.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: AIOHTTP: Base64 multipart parts bypass client_max_size

CVE: GHSA-24c4-3p7v-29cm AIOHTTP: Base64 multipart parts bypass client_max_size (HIGH)

Affected versions: < 3.14.4

Patched version: 3.14.4

From: packages/hw-emulator/pyproject.toml → pypi/aiohttp@3.14.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/aiohttp@3.14.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: AIOHTTP: WebSocket max_msg_size bypass via integer overflow

CVE: GHSA-3rp8-rxj8-mvjw AIOHTTP: WebSocket max_msg_size bypass via integer overflow (HIGH)

Affected versions: < 3.14.4

Patched version: 3.14.4

From: packages/hw-emulator/pyproject.toml → pypi/aiohttp@3.14.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/aiohttp@3.14.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: AIOHTTP: Unbounded buffering of data received during an upgrade request

CVE: GHSA-pw86-h8fm-j323 AIOHTTP: Unbounded buffering of data received during an upgrade request (HIGH)

Affected versions: < 3.14.4

Patched version: 3.14.4

From: packages/hw-emulator/pyproject.toml → pypi/aiohttp@3.14.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/aiohttp@3.14.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: AIOHTTP: Pure-Python parser request replay and buffer growth behind a declined upgrade

CVE: GHSA-28qf-cpwq-vmc2 AIOHTTP: Pure-Python parser request replay and buffer growth behind a declined upgrade (HIGH)

Affected versions: < 3.14.4

Patched version: 3.14.4

From: packages/hw-emulator/pyproject.toml → pypi/aiohttp@3.14.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/aiohttp@3.14.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
High priority
High CVE: AIOHTTP: Concatenated compressed streams cause excessive CPU use

CVE: GHSA-h4cc-hm5h-fmm9 AIOHTTP: Concatenated compressed streams cause excessive CPU use (HIGH)

Affected versions: < 3.14.4

Patched version: 3.14.4

From: packages/hw-emulator/pyproject.toml → pypi/aiohttp@3.14.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/aiohttp@3.14.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block
See 148 more rows in the dashboard

View full report

@montelaidev

montelaidev commented May 28, 2026 •

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

Comment thread packages/hw-emulator/package.json Resolved
Comment thread packages/hw-emulator/docker-compose.yml Resolved
Comment thread packages/hw-emulator/docker-compose.yml Resolved
@montelaidev

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

Copy link
Copy Markdown

Preview builds have been published. See these instructions (from the core monorepo) for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/account-api": "1.0.4-4bf3baf",
  "@metamask-previews/hw-emulator": "0.1.0-4bf3baf",
  "@metamask-previews/hw-wallet-sdk": "0.8.0-4bf3baf",
  "@metamask-previews/keyring-api": "23.1.0-4bf3baf",
  "@metamask-previews/eth-hd-keyring": "14.1.1-4bf3baf",
  "@metamask-previews/eth-ledger-bridge-keyring": "12.1.0-4bf3baf",
  "@metamask-previews/eth-money-keyring": "3.0.0-4bf3baf",
  "@metamask-previews/eth-qr-keyring": "2.1.0-4bf3baf",
  "@metamask-previews/eth-simple-keyring": "12.0.2-4bf3baf",
  "@metamask-previews/eth-trezor-keyring": "10.1.0-4bf3baf",
  "@metamask-previews/keyring-internal-api": "11.0.1-4bf3baf",
  "@metamask-previews/keyring-internal-snap-client": "10.0.3-4bf3baf",
  "@metamask-previews/keyring-sdk": "2.1.1-4bf3baf",
  "@metamask-previews/eth-snap-keyring": "22.1.0-4bf3baf",
  "@metamask-previews/keyring-snap-client": "9.0.2-4bf3baf",
  "@metamask-previews/keyring-snap-sdk": "9.0.1-4bf3baf",
  "@metamask-previews/keyring-utils": "3.3.1-4bf3baf"
}

Spike browser scripts named test.js are picked up by jest's default
testMatch and fail with 'document is not defined' in the node
environment.
@montelaidev montelaidev reopened this Sep 10, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 5 potential issues.

There are 6 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit de887b2. Configure here.

Comment thread packages/speculos-up/src/index.ts Resolved
Comment thread packages/speculos-up/src/index.ts Resolved
Comment thread .github/workflows/build-speculos.yml Resolved
@github-actions github-actions Bot removed the Stale label Sep 11, 2026
bumble's android_netsim transport imports google.protobuf at runtime;
grpcio does not pull it in transitively, so fresh virtualenvs failed at
import time. Also refresh yarn.lock with the @metamask/eth-sig-util@8.2.0
entry for the already-committed hw-emulator dependency.
…idable

The hard-coded 30s APDU fuse raced the E2E device-approval automation
(adaptive button-press flows can take ~50s worst case), killing signing
exchanges mid-approval. Default raised to 120s; override with
SPECULOS_APDU_TIMEOUT.
Forward deletion only — prior history is left untouched.
…hon/ and tests/python/

Aligns the package layout with standard Python conventions: the
setuptools/hatch package dir becomes python/speculos_ble, pytest testpaths
become tests/python, and the Dockerfile COPY, package.json files/scripts,
README, and SpeculosBleRunner path resolution are updated accordingly.
No functional changes; venv location (.venv) and the speculos_ble package
name are unchanged.
- speculos-up: resolve the package root via package.json so bundled
  archives and checksum verification work in the published cjs/mjs build
  (the extensionless ./utils specifier never resolves against dist)
- speculos-up: fall back to sourceDir when Dirent.parentPath is unavailable
- hw-emulator: run the native Speculos process from the bundled nvram/
  directory so --load-nvram finds main_nvram.bin
- require Node >=26 for the speculos packages
- add regression tests and CHANGELOG entries

Also folds in incidental repo maintenance from yarn lint:fix (README
merge-marker cleanup, tsconfig/package.json formatting, lockfile dedupe).
montelaidev and others added 2 commits November 3, 2026 09:27
….parentPath

installBinaries() now derives each entry path from the `sourceDir`
argument (the directory the entries were read from) instead of the
`Dirent.parentPath` property, which is only populated on newer runtimes.
Uses only APIs supported on Node 22+.
…forgery'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ease

Pin actions/checkout, actions/setup-python, actions/upload-artifact and
actions/download-artifact to commit SHAs (blanket pinning policy).

Replace softprops/action-gh-release with the GitHub CLI (gh release
create / gh release upload), matching the MetaMask convention — no
third-party action is used to publish release assets.
montelaidev and others added 9 commits November 3, 2026 09:47
…forgery'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Prevent the GITHUB_TOKEN from being persisted in the local git config,
since no step in this workflow pushes via git credentials.
- Drop --experimental-vm-modules from the jest scripts: main removed it in
  #696 because requiring the ESM-only @metamask/eth-sig-util v10 throws
  ERR_REQUIRE_ESM under it, which failed every test suite that imports it.
- Align devDependency ranges with the monorepo so `yarn constraints` passes,
  bump @metamask/eth-sig-util to ^10.0.0, and dedupe the lockfile.
- Remove an unnecessary type assertion that eslint flags in extract.ts.
- Make two hw-emulator tests host-independent: match a closed port by error
  code (a reset arrives as "socket hang up") and connect to a free port
  instead of the default APDU port a running emulator may hold.
- Pack the hardlink fixture with sync: true; tar's async pending-link path
  could end the gzip stream twice and fail the run with an unhandled ZlibError.
- Changelogs: link entries to #560, let auto-changelog order the Unreleased
  sections, and drop the keyring-eth-trezor entry that landed in the released
  [11.0.1] section (the IN_TEST change never existed on main).
- Rebuild the linux-amd64 and linux-arm64 archives from the 0.27.8 PyPI
  release and regenerate bundled/checksums.json.
- Point the default version, build scripts, CI workflow, and docs at 0.27.8.
- Fix the release build for 0.27: it moved imports into speculos/__init__.py,
  so build against a launcher shim, bundle backports.tarfile for pkg_resources,
  and smoke-test the binary with --help (Docker, native, and CI paths).
- Keep the hw-emulator Docker image on 0.25.13: no later version tag is
  published on ghcr.io/ledgerhq/speculos.
- hw-emulator: ethereumjs 10, secp256k1 5, ethereum-cryptography 3,
  keystone BC-UR 0.23, zxing 0.23, ws 8.23, uuid 11, plus latest dev
  tooling (jest 30, TypeScript 5.9, typedoc 0.28).
- speculos-up: tar 8 with extract migrated to the Promise API, plus the
  same dev tooling set.
- Vendor the Ledger HID framing helper removed in @ledgerhq/devices v8
  and cover it with tests.
- Allow the resulting version skew via ALLOWED_INCONSISTENT_DEPENDENCIES
  and scope the tar resolution so node-gyp/cacache stay on patched tar 7.
- @metamask/utils and uuid stay on their latest dual-format versions
  (v12+ is ESM-only).
…y/bip39

@metamask/bip39 was last published in 2022. ethereum-cryptography is
already a direct dependency, and its `bip39` subpath re-exports
`mnemonicToSeedSync` from @scure/bip39, so this drops one dependency
without changing the seed derivation.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants