Skip to content

fix: return false when ERC-6492 verifier ecrecover yields zero address - #5468

Merged
jxom merged 4 commits into
mainfrom
fix/erc6492-verifier-zero-signer
Nov 11, 2026
Merged

jxom merged 4 commits into
mainfrom
fix/erc6492-verifier-zero-signer

Conversation

@jxom

@jxom jxom commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

The ERC-6492 signature verifier now returns false when ECDSA recovery yields the zero address instead of treating it as a match, and verifyHash now returns false for the zero address before calling any verifier. The embedded deployless verifier bytecode was rebuilt (solc 0.8.26, optimizer 200 runs, paris, no metadata, which reproduces the previous constant from the unchanged source). Tests cover the zero address through verifyHash and verifyMessage, a deployed verifier, and the embedded bytecode directly.

@changeset-bot

changeset-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0a0e72b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
viem Error Error Nov 11, 2026 5:15am UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T05:13:57.786495Z 0a0e72b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb3d236c83

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +8 to +10
import { zeroAddress } from '../../constants/address.js'
import { concat } from '../../utils/data/concat.js'
import { pad } from '../../utils/data/pad.js'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Import public test helpers from the package entrypoint

The new imports of zeroAddress, concat, and pad bypass the public package entrypoint, contrary to the explicit testing convention in AGENTS.md. All three are exported from viem, so import them from there instead; also update the newly added zeroAddress import in verifyHash.test.ts. This keeps the regression tests aligned with the required public-surface import boundary.

AGENTS.md reference: AGENTS.md:L188-L193

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Switched the new imports in both test files to 'viem' in 73c3060.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

After rebasing, these imports are still from 'viem' in f7f306d, merged with the imports added on main.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Published [email protected] under the pr-5468 dist-tag, which follows this pull request until it closes.

pnpm add viem@pr-5468
pnpm add [email protected]

@jxom
jxom force-pushed the fix/erc6492-verifier-zero-signer branch from 73c3060 to 1fd7058 Compare November 11, 2026 04:10
@jxom
jxom enabled auto-merge (squash) November 11, 2026 04:39
@jxom
jxom disabled auto-merge November 11, 2026 04:39
@jxom
jxom enabled auto-merge (squash) November 11, 2026 04:39
@jxom
jxom force-pushed the fix/erc6492-verifier-zero-signer branch from 1fd7058 to cbc3a8a Compare November 11, 2026 04:42
@jxom
jxom force-pushed the fix/erc6492-verifier-zero-signer branch from cbc3a8a to 0a0e72b Compare November 11, 2026 05:12
@jxom
jxom merged commit 0231beb into main Nov 11, 2026
32 of 33 checks passed
@jxom
jxom deleted the fix/erc6492-verifier-zero-signer branch November 11, 2026 05:12
@github-actions github-actions Bot mentioned this pull request Nov 11, 2026
jxom added a commit to wevm/ox that referenced this pull request Nov 15, 2026
…encodePacked` (#683)

* fix: return false from the ERC-6492 validator when ecrecover yields the zero address

Ports wevm/viem#5468. ecrecover returns the zero address for a malformed signature, so the deployless validator accepted any such signature for the zero address. The bytecode is rebuilt from the updated UniversalSigValidator.sol with solc 0.8.26, 200 optimizer runs, the paris EVM version, and no metadata, which reproduces the previous constant from the previous source.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ddd3-d469-72eb-a88c-673c40859557
Co-authored-by: Amp <[email protected]>
Co-authored-by: jxom <[email protected]>

* fix: reject odd-length hex for bytes in AbiParameters.encodePacked

Ports the encodePacked half of wevm/viem#5466. An odd-length bytes value was concatenated as is, shifting every later value by a nibble. It now throws Hex.InvalidLengthError, matching AbiParameters.encode since #617; viem left-pads instead.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ddd3-d469-72eb-a88c-673c40859557
Co-authored-by: Amp <[email protected]>
Co-authored-by: jxom <[email protected]>

---------

Co-authored-by: Amp <[email protected]>
Co-authored-by: jxom <[email protected]>
jxom added a commit to wevm/ox that referenced this pull request Nov 15, 2026
…s.encodePacked` and `Address.checksum` (#684)

* fix: return false from the ERC-6492 validator when ecrecover yields the zero address

Ports wevm/viem#5468. ecrecover returns the zero address for a malformed signature, so the deployless validator accepted any such signature for the zero address. The bytecode is rebuilt from the updated UniversalSigValidator.sol with solc 0.8.26, 200 optimizer runs, the paris EVM version, and no metadata, which reproduces the previous constant from the previous source.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ddd3-d469-72eb-a88c-673c40859557
Co-authored-by: Amp <[email protected]>
Co-authored-by: jxom <[email protected]>

* fix: reject odd-length hex for bytes in AbiParameters.encodePacked

Ports the encodePacked half of wevm/viem#5466. An odd-length bytes value was concatenated as is, shifting every later value by a nibble. It now throws Hex.InvalidLengthError, matching AbiParameters.encode since #617; viem left-pads instead.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ddd3-d469-72eb-a88c-673c40859557
Co-authored-by: Amp <[email protected]>
Co-authored-by: jxom <[email protected]>

* perf: share the Address.checksum result across address casings

Ports wevm/viem#5514. The checksum depends only on the lowercase address, so a result computed for one casing is reused for the others instead of hashing again. main already does this.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ddd3-d469-72eb-a88c-673c40859557
Co-authored-by: Amp <[email protected]>
Co-authored-by: jxom <[email protected]>

---------

Co-authored-by: Amp <[email protected]>
Co-authored-by: jxom <[email protected]>

This branch had an error being deployed

1 failed deployment
Preview — 0a0e72bf Deployed Nov 11, 2026 by vercel[bot]
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