We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Huge Navy Condor
Medium
here in the verify function we are not verifying the nonce as we are keeping that value is zero.
https://github.com/sherlock-audit/2024-11-autonomint/blob/main/Blockchain/Blockchian/contracts/Core_logic/CDS.sol#L864 function verify( bytes memory odosExecutionData, bytes memory signature ) external view onlyBorrowingContract returns (bool) { return _verify( FunctionName.BORROW_WITHDRAW, 0, 0, odosExecutionData, signature ); }
function _verify( FunctionName functionName, uint256 excessProfitCumulativeValue, uint256 nonce, bytes memory odosExecutionData, bytes memory signature ) private view returns (bool) { bytes32 digest; if (functionName == FunctionName.CDS_WITHDRAW) { digest = _hashTypedDataV4( keccak256( abi.encode( keccak256( "Permit(uint256 excessProfitCumulativeValue,uint256 nonce)" ), excessProfitCumulativeValue, nonce ) ) ); } else if (functionName == FunctionName.BORROW_WITHDRAW) { digest = _hashTypedDataV4( keccak256( abi.encode( keccak256("OdosPermit(bytes odosExecutionData)"), odosExecutionData ) ) ); } address signer = ECDSA.recover(digest, signature); bytes32 hashedSigner = keccak256(abi.encodePacked(signer)); if (hashedSigner == hashedAdminTwo) { return true; } else { return false; } }
}
No response
verify can be replayed.
donot keep the nonce as zero as constant.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Huge Navy Condor
Medium
wrong implement of verify.
Summary
here in the verify function we are not verifying the nonce as we are keeping that value is zero.
Root Cause
https://github.com/sherlock-audit/2024-11-autonomint/blob/main/Blockchain/Blockchian/contracts/Core_logic/CDS.sol#L864
function verify(
bytes memory odosExecutionData,
bytes memory signature
) external view onlyBorrowingContract returns (bool) {
return
_verify(
FunctionName.BORROW_WITHDRAW,
0,
0,
odosExecutionData,
signature
);
}
}
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
verify can be replayed.
PoC
No response
Mitigation
donot keep the nonce as zero as constant.
The text was updated successfully, but these errors were encountered: