Security Audit: 5 Medium Findings with Fixes#288
Open
AdeshAtole wants to merge 1 commit intoopenbook-dex:masterfrom
Open
Security Audit: 5 Medium Findings with Fixes#288AdeshAtole wants to merge 1 commit intoopenbook-dex:masterfrom
AdeshAtole wants to merge 1 commit intoopenbook-dex:masterfrom
Conversation
1. [Medium] place_take_order fees permanently locked in vault - route referrer_amount to fees_available 2. [Medium] Missing owner check on Deposit allows griefing - add is_owner_or_delegate constraint 3. [Medium] Event heap full causes panic on taker orders - add graceful check before matching Full audit report in AUDIT_REPORT.md with 5 findings total.
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.
Security Audit Report
Findings (all Medium severity)
1. Fees from
place_take_orderpermanently locked in vaultinstructions/place_take_order.rs:51referrer_amountis added tofees_accruedbut never tofees_available, making it unsweepablereferrer_amounttofees_availableinplace_take_order2. Missing owner check on Deposit allows griefing
accounts_ix/deposit.rsis_owner_or_delegatecheck)is_owner_or_delegateconstraint3.
DecrementTakeself-trade pollutes event heapstate/orderbook/book.rs:141-1554. Full event heap panics all taker orders (DoS)
state/orderbook/book.rs:206(push_backasserts !full)5.
execute_makerslot reuse race conditionstate/orderbook/book.rs:294,open_orders_account.rs:279Code fixes applied for findings 1, 2, and 4.
Full report in
AUDIT_REPORT.md.