7fa85b2: fix(ai): use injective serialization for tool approval HMAC payload
The tool approval signature (experimental_toolApprovalSecret) built its HMAC
payload by joining fields with \n. Because fields such as toolName and
toolCallId can themselves contain a newline, distinct field tuples could
serialize to identical bytes, allowing a signed approval to verify against a
different tuple. The payload is now serialized with JSON.stringify (with a
versioned domain-separation prefix), which escapes delimiter/control characters
and makes the encoding injective.
Verification remains backwards compatible: a signature in the old format still
verifies, but only when no field contains the \n delimiter (the condition
that made the old format ambiguous), so a pending approval that straddles an
upgrade is not rejected while the collision stays closed.
Configuration
📅 Schedule: (UTC)
Branch creation
At any time (no schedule defined)
Automerge
At any time (no schedule defined)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
If you want to rebase/retry this PR, check this box
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
Release Notes
vercel/ai (ai)v7.0.37
Compare Source
Patch Changes
v7.0.36
Compare Source
Patch Changes
7fa85b2: fix(ai): use injective serialization for tool approval HMAC payload
The tool approval signature (experimental_toolApprovalSecret) built its HMAC
payload by joining fields with \n. Because fields such as toolName and
toolCallId can themselves contain a newline, distinct field tuples could
serialize to identical bytes, allowing a signed approval to verify against a
different tuple. The payload is now serialized with JSON.stringify (with a
versioned domain-separation prefix), which escapes delimiter/control characters
and makes the encoding injective.
Verification remains backwards compatible: a signature in the old format still
verifies, but only when no field contains the \n delimiter (the condition
that made the old format ambiguous), so a pending approval that straddles an
upgrade is not rejected while the collision stays closed.
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.