Repository navigation
fix: reject zero-address signer in signature verification - #688
Merged
Merged
Conversation
SgtPooki
commented
Dec 1, 2026
SgtPooki
left a comment
Contributor
Author
There was a problem hiding this comment.
self review.. not familiar with solidity too much but it looks coherent and straightforward
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the signature-verification hardening.
No open issues 🎉
What changed in this PR
Hardens Filecoin Warm Storage Service signature verification by rejecting zero-address recovery before session-key lookup. This prevents invalid signatures from being accepted when a payer has authorized address(0).
Changes:
- Reject zero-address signers with the new
SignatureRecoveryFailed()error. - Add regression tests for zero-address rejection and valid payer/session-key signatures.
- Update generated interfaces, ABIs, and the changelog.
| File | Description |
|---|---|
service_contracts/test/FilecoinWarmStorageService.t.sol |
Tests zero-address rejection and valid signature acceptance. |
service_contracts/src/lib/LibSignatureVerification.sol |
Rejects zero-address recovery before returning the signer. |
service_contracts/src/interfaces/IFilecoinWarmStorageService.sol |
Exposes the new recovery error. |
service_contracts/src/Errors.sol |
Defines SignatureRecoveryFailed(). |
service_contracts/abi/FilecoinWarmStorageService.abi.json |
Adds the recovery error to the service ABI. |
service_contracts/abi/Errors.abi.json |
Adds the recovery error to the errors ABI. |
CHANGELOG.md |
Documents the signature-verification hardening. |
Review effort: Balanced
wjmelements
approved these changes
Dec 2, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
LibSignatureVerification.recoverSignerreturned whateverecrecoverproduced, includingaddress(0), which is whatecrecoverreturns for a well-formed signature that recovers to no key. FWSS then looked that address up as a session key. If a payer had ever authorizedaddress(0)in SessionKeyRegistry, any such signature would have been accepted as that payer for the operations it was authorized for.This is hardening: it only matters for a payer that has authorized the zero address.
Change
recoverSignerreverts with a newErrors.SignatureRecoveryFailed()when the recovered address is zero. Both FWSS verification paths (CreateDataSet, and the shared path for the other signed operations) go through it, so the check runs before any session key lookup.ServiceProviderRegistry._recoverSigneralready rejected a zero result; this brings FWSS in line with it.IFilecoinWarmStorageServiceare regenerated for the new error. Changelog entry added under Unreleased.SessionKeyRegistry
It would also be reasonable for
login()to refuseaddress(0). That contract is not in this repo: it comes from thelib/session-key-registrysubmodule (FilOzone/SessionKeyRegistry) and is deployed as a plain, non-upgradeable contract, so it is not changed here.Related
FilOzone/synapse-sdk#1192 adds the client-side counterpart: the SDK refuses to authorize the zero address as a session key.
Verification
mainand pass with the change:testRecoverSignerRejectsZeroAddress: a zero-recovering signature reverts withSignatureRecoveryFailed.testVerifyRejectsZeroSignerEvenWhenPayerAuthorizedIt: the same signature is rejected even after the payer logsaddress(0)in for CreateDataSet.testVerifyAcceptsPayerAndAuthorizedSessionKey: a valid payer signature and a valid authorized session key signature still pass.forge fmt --check,forge lint --deny notes,make build,make genandmake update-abiare clean.make test: 1179 passed, 0 failed across 39 suites.make contract-size-checkpasses.make check-josukereports no blocking findings.