A critical security vulnerability has been discovered in the WithdrawalRequest library's load()
function, where unchecked inline assembly operations allow direct storage pointer manipulation. This vulnerability enables attackers to potentially access and manipulate withdrawal requests belonging to other users, compromising the integrity of the entire system.
Location:
Technical Analysis:
The function uses inline assembly to directly manipulate storage pointers
No validation exists for the computed storage slot
Predictable slot calculation pattern enables collision attacks
Pure function modifier prevents state validation
Direct Storage Manipulation - Inline assembly bypasses Solidity's safety checks
Storage pointer assignment without validation
Missing bounds checking on computed slots
State Validation Issues - Pure function modifier prevents state verification
No initialization checks on storage slots
Missing access control mechanisms
Severity: Critical
Potential Attacks:
Unauthorized Access to Withdrawal Requests
Fund Theft Through Request Manipulation
Data Tampering and Integrity Breaches
Denial of Service Attacks
Business Impact:
Financial losses through unauthorized withdrawals
System reputation damage
Loss of user trust
Potential regulatory compliance issues
Static analysis tools for initial detection
Manual code review for vulnerability verification
Foundry test framework for proof of concept
Assembly-level debugging tools
Here's a Foundry test demonstrating the vulnerability:
Immediate Fixes:```solidity
library WithdrawalRequest {
// Add unique salt to prevent collisions
bytes32 private constant STORAGE_SLOT_SALT = keccak256("WithdrawalRequest.v2");
function load(
uint128 vaultId,
address account,
uint128 withdrawalRequestId
) internal view returns (Data storage withdrawalRequest)
{
bytes32 slot = keccak256(abi.encodePacked(
STORAGE_SLOT_SALT,
WITHDRAWAL_REQUEST_LOCATION,
vaultId,
account,
withdrawalRequestId
));
}
}
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.