Claude/eager hamilton n9mj23 - #150
Merged
Merged
Conversation
Fixes two pre-audit findings. 1. pool-core: a hostile CW20 on a standard pool could spoof cw20_msg.sender on the swap path to stamp a victim LP's shared rate-limit key (USER_LAST_COMMIT) and indefinitely block their RemoveLiquidity — freezing their only exit. Split the liquidity-op cooldown into its own USER_LAST_LIQUIDITY_OP map, keyed only on the real info.sender, so no swap (spoofed or not) can ever block a deposit or withdrawal. Swaps/commits keep USER_LAST_COMMIT. 2. router: hop pool_addr was never validated against the factory registry, so a malicious frontend could route user funds to an arbitrary contract with minimum_receive as the only guard. Add a factory PoolByAddress registry query and validate every hop (registration + declared pair) before any funds move; the stored factory_addr is now load-bearing instead of dead config. Adds regression tests for both, plus a mock factory for the router test harness. Full deterministic suite green (644 tests).
Replace the three prior review documents (SECURITY_REVIEW_PREAUDIT.md, FUZZ_REVIEW.md, fuzz-stateful/FINDINGS.md) with a single consolidated SECURITY_AUDIT.md. The report records the current findings, marks F-1 (LP withdrawal freeze) and F-2 (router hop validation) as fixed on this branch, and notes F-9 (first-deposit reserve floor) found via the stateful fuzz harness. FUZZING.md (run instructions) is retained.
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.
No description provided.