Skip to content

fix(cryptography): only pass AES-GCM additionalData when provided - #10757

Merged
mathieuartu merged 2 commits into
mainfrom
fix/cryptography-aes-gcm-additional-data
Oct 8, 2026
Merged

mathieuartu merged 2 commits into
mainfrom
fix/cryptography-aes-gcm-additional-data

Conversation

@mathieuartu

@mathieuartu mathieuartu commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Explanation

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Small WebCrypto call-shape fix for omitted associated data; no change when additionalData is explicitly provided.

Overview
Fixes AES-GCM encrypt and decrypt failing in browsers (e.g. Chrome) when callers omit associated data.

The WebCrypto parameter objects no longer include an additionalData key with value undefined; additionalData is only spread into the algorithm descriptor when options.additionalData is set. Behavior when associated data is supplied is unchanged.

Adds Jest spies on crypto.subtle.encrypt / decrypt to assert the property is absent when no associated data is passed, and documents the fix in the package changelog.

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

@mathieuartu mathieuartu self-assigned this Oct 8, 2026
@mathieuartu
mathieuartu requested a review from a team as a code owner October 8, 2026 16:48
@mathieuartu
mathieuartu deployed to default-branch October 8, 2026 16:48 — with GitHub Actions Active
@mathieuartu

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@11.0.1-preview-23d340d
@metamask-previews/accounts-controller@40.0.0-preview-23d340d
@metamask-previews/address-book-controller@8.0.0-preview-23d340d
@metamask-previews/advanced-chart-core@1.0.0-preview-23d340d
@metamask-previews/ai-controllers@2.0.0-preview-23d340d
@metamask-previews/analytics-controller@4.0.0-preview-23d340d
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-23d340d
@metamask-previews/announcement-controller@9.0.0-preview-23d340d
@metamask-previews/app-metadata-controller@3.0.0-preview-23d340d
@metamask-previews/approval-controller@10.0.0-preview-23d340d
@metamask-previews/assets-controller@18.0.1-preview-23d340d
@metamask-previews/assets-controllers@112.1.2-preview-23d340d
@metamask-previews/authenticated-user-storage@4.1.0-preview-23d340d
@metamask-previews/base-controller@10.0.0-preview-23d340d
@metamask-previews/base-data-service@2.1.0-preview-23d340d
@metamask-previews/bitcoin-regtest-up@2.0.0-preview-23d340d
@metamask-previews/bridge-controller@82.0.2-preview-23d340d
@metamask-previews/bridge-status-controller@76.3.5-preview-23d340d
@metamask-previews/build-utils@4.0.0-preview-23d340d
@metamask-previews/chain-agnostic-permission@2.0.0-preview-23d340d
@metamask-previews/chomp-api-service@6.0.1-preview-23d340d
@metamask-previews/claims-controller@1.0.3-preview-23d340d
@metamask-previews/client-controller@2.0.0-preview-23d340d
@metamask-previews/client-utils@3.0.4-preview-23d340d
@metamask-previews/compliance-controller@3.0.0-preview-23d340d
@metamask-previews/composable-controller@13.0.0-preview-23d340d
@metamask-previews/config-registry-controller@5.0.0-preview-23d340d
@metamask-previews/connectivity-controller@1.0.0-preview-23d340d
@metamask-previews/controller-utils@13.0.0-preview-23d340d
@metamask-previews/core-backend@12.0.1-preview-23d340d
@metamask-previews/cryptography@1.1.1-preview-23d340d
@metamask-previews/delegation-controller@4.0.0-preview-23d340d
@metamask-previews/earn-controller@13.0.2-preview-23d340d
@metamask-previews/eip-5792-middleware@4.0.1-preview-23d340d
@metamask-previews/eip-7702-internal-rpc-middleware@1.0.0-preview-23d340d
@metamask-previews/eip1193-permission-middleware@3.0.0-preview-23d340d
@metamask-previews/eth-block-tracker@16.0.0-preview-23d340d
@metamask-previews/eth-json-rpc-middleware@25.0.0-preview-23d340d
@metamask-previews/eth-json-rpc-provider@7.0.0-preview-23d340d
@metamask-previews/foundryup@2.0.0-preview-23d340d
@metamask-previews/gas-fee-controller@27.0.0-preview-23d340d
@metamask-previews/gator-permissions-controller@6.0.1-preview-23d340d
@metamask-previews/geolocation-controller@2.0.0-preview-23d340d
@metamask-previews/java-tron-up@2.0.0-preview-23d340d
@metamask-previews/json-rpc-engine@11.0.0-preview-23d340d
@metamask-previews/json-rpc-middleware-stream@9.0.0-preview-23d340d
@metamask-previews/keyring-controller@28.1.0-preview-23d340d
@metamask-previews/kyc-controller@0.6.1-preview-23d340d
@metamask-previews/local-node-utils@2.0.0-preview-23d340d
@metamask-previews/logging-controller@10.0.0-preview-23d340d
@metamask-previews/message-manager@15.0.0-preview-23d340d
@metamask-previews/messenger@3.0.0-preview-23d340d
@metamask-previews/messenger-cli@1.0.0-preview-23d340d
@metamask-previews/money-account-api-data-service@2.1.0-preview-23d340d
@metamask-previews/money-account-balance-service@3.1.2-preview-23d340d
@metamask-previews/money-account-controller@2.0.0-preview-23d340d
@metamask-previews/money-account-upgrade-controller@5.1.0-preview-23d340d
@metamask-previews/money-account-utils@2.1.0-preview-23d340d
@metamask-previews/multichain-account-service@14.1.0-preview-23d340d
@metamask-previews/multichain-api-middleware@5.0.0-preview-23d340d
@metamask-previews/multichain-network-controller@4.0.0-preview-23d340d
@metamask-previews/multichain-transactions-controller@8.0.0-preview-23d340d
@metamask-previews/name-controller@10.0.0-preview-23d340d
@metamask-previews/network-connection-banner-controller@1.0.0-preview-23d340d
@metamask-previews/network-controller@37.0.1-preview-23d340d
@metamask-previews/network-enablement-controller@7.0.2-preview-23d340d
@metamask-previews/notification-services-controller@29.0.3-preview-23d340d
@metamask-previews/passkey-controller@4.1.0-preview-23d340d
@metamask-previews/permission-controller@14.0.0-preview-23d340d
@metamask-previews/permission-log-controller@6.0.0-preview-23d340d
@metamask-previews/perps-controller@20.0.0-preview-23d340d
@metamask-previews/phishing-controller@18.2.0-preview-23d340d
@metamask-previews/platform-api-docs@0.2.1-preview-23d340d
@metamask-previews/polling-controller@17.0.0-preview-23d340d
@metamask-previews/preferences-controller@24.0.0-preview-23d340d
@metamask-previews/profile-controller@1.0.1-preview-23d340d
@metamask-previews/profile-metrics-controller@5.1.3-preview-23d340d
@metamask-previews/profile-sync-controller@34.0.1-preview-23d340d
@metamask-previews/ramps-controller@26.3.0-preview-23d340d
@metamask-previews/rate-limit-controller@8.0.0-preview-23d340d
@metamask-previews/react-data-query@2.0.0-preview-23d340d
@metamask-previews/remote-feature-flag-controller@7.0.0-preview-23d340d
@metamask-previews/sample-controllers@6.0.0-preview-23d340d
@metamask-previews/seedless-onboarding-controller@11.0.1-preview-23d340d
@metamask-previews/selected-network-controller@27.0.0-preview-23d340d
@metamask-previews/sentinel-api-service@2.1.0-preview-23d340d
@metamask-previews/shield-controller@7.0.4-preview-23d340d
@metamask-previews/signature-controller@40.0.0-preview-23d340d
@metamask-previews/smart-transactions-controller@27.1.0-preview-23d340d
@metamask-previews/snap-account-service@4.0.0-preview-23d340d
@metamask-previews/social-controllers@3.6.0-preview-23d340d
@metamask-previews/solana-test-validator-up@2.0.0-preview-23d340d
@metamask-previews/stellar-quickstart-up@0.0.0-preview-23d340d
@metamask-previews/storage-service@2.0.0-preview-23d340d
@metamask-previews/subscription-controller@12.0.1-preview-23d340d
@metamask-previews/transaction-controller@72.1.0-preview-23d340d
@metamask-previews/transaction-pay-controller@30.0.1-preview-23d340d
@metamask-previews/user-operation-controller@42.0.1-preview-23d340d
@metamask-previews/utils@12.0.0-preview-23d340d
@metamask-previews/wallet@16.0.1-preview-23d340d
@metamask-previews/wallet-cli@0.0.0-preview-23d340d

@mathieuartu
mathieuartu enabled auto-merge October 8, 2026 18:28

@mcmire mcmire left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Makes sense!

@mathieuartu
mathieuartu added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit 5cefff1 Oct 8, 2026
145 checks passed
@mathieuartu
mathieuartu deleted the fix/cryptography-aes-gcm-additional-data branch October 8, 2026 18:50
@cursor cursor Bot mentioned this pull request Oct 8, 2026
3 of 4 tasks
Naz-Ovh pushed a commit to 0x-fork/metamask-core that referenced this pull request Oct 10, 2026
## Explanation

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->

## References

<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?

For example:

* Fixes #12345
* Related to #67890
-->

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Patch-level dependency propagation with a narrow AES-GCM Web Crypto
compatibility fix; no breaking API or logic changes in this PR’s diff.
> 
> **Overview**
> **Monorepo release 1321.0.0** that publishes
**`@metamask/cryptography@1.1.2`** and rolls that fix through
**`@metamask/profile-sync-controller@34.0.3`** and every package that
depends on profile sync.
> 
> The substantive change being released is in **cryptography**: AES-GCM
**`encrypt`/`decrypt` no longer pass `additionalData: undefined` into
Web Crypto**, which Chrome rejects
([MetaMask#10757](MetaMask#10757)). Profile sync
bumps its **`@metamask/cryptography`** range to **`^1.1.2`**
([MetaMask#10761](MetaMask#10761)); changelogs and
**`package.json`** across account-tree, assets, bridge, claims,
core-backend, kyc, notifications, profile*, ramps, shield,
smart-transactions, social, subscription, and related workspaces now
require **`@metamask/profile-sync-controller@^34.0.3`**. **`yarn.lock`**
is updated to match.
> 
> There are **no new controller or service code changes** in this
diff—only version bumps, changelog entries, and lockfile updates.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
003c8a8. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants