fix: close two paths that can permanently strand a name - #301
Open
re-gius wants to merge 2 commits into
Open
Conversation
Contributor
CI Summary
|
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.
Description
Two fixes from the internal audit, both cases where a name ends up immovable with no shipped call to recover it.
Unsolicited escrow deposits. The escrow refuses a deposit it did not initiate in
onERC721Received, but that hook never runs on a plaintransferFrom. A direct transfer to the escrow address therefore reached_update, which treats every escrow-touching move as zero-fee, and landed the name in custody with no release position._updatenow rejects a transfer into the escrow unless the escrow is the caller.releaserecords the position before it moves the name and is the only caller that transfers into custody, so the legitimate path is unaffected.Poisoned recipient slots.
_syncRecipientStorewrote throughStoreUtils.writeLabel, which skips an occupied slot silently. A slot already holding a different string then survived the transfer, and_quoteTransferFeeForreads that label back and revertsInvalidLabelon every onward transfer permanently, sincestoreLabelhas no delete. It now useswriteNewLabel, the conflict-checked variant every registration path already uses, so a mismatch reverts the transfer and leaves the name with its sender. A matching entry stays a no-op, so a transfer back to a prior holder still passes.writeLabelis deleted with it: it had no caller left, and a skip-on-locked helper in a shared library keeps the same defect one call away. Every protocol write now goes through the conflict check because there is nothing else to call.Also corrects
README.md, which told readers that "transferring the name reassigns write access automatically". That holds for the node transferred and not for its subnames, whose registry owner a parent transfer does not change.Type
Scope
Related Issues
Internal security audit findings with low severity.
Fixes
Checklist
Code
forge buildpassesforge testpassesTesting
Security
selfdestructordelegatecallDocumentation
Breaking Changes
Breaking changes:
How to test
Notes