Closed c4-submissions closed 1 year ago
raymondfam marked the issue as primary issue
raymondfam marked the issue as sufficient quality report
raymondfam marked the issue as high quality report
raymondfam marked the issue as low quality report
The Warden has made invalid statements and does not understand how the Gnosis Safe IGnosisSafe::signedMessages
function works. Specifically:
IGnosisSafe::signedMessages
would indicate that the actual message has already been pre-approved by all necessary members of the Gnosis Safe. As such, it is secure to consider a non-zero entry as a signed message.As a result of the above, I consider this exhibit invalid.
alex-ppg marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-10-brahma/blob/c217699448ffd7ec0253472bf0d156e52d45ca71/contracts/src/core/ConsoleFallbackHandler.sol#L68-L71 https://github.com/code-423n4/2023-10-brahma/blob/c217699448ffd7ec0253472bf0d156e52d45ca71/contracts/src/core/ConsoleFallbackHandler.sol#L42-L53 https://github.com/code-423n4/2023-10-brahma/blob/c217699448ffd7ec0253472bf0d156e52d45ca71/contracts/src/core/ConsoleFallbackHandler.sol#L68 https://github.com/code-423n4/2023-10-brahma/blob/c217699448ffd7ec0253472bf0d156e52d45ca71/contracts/src/core/ConsoleFallbackHandler.sol#L43-L44
Vulnerability details
Impact
Potential issues with signature validation logic in
getMessageHash
and usage inisValidSignature
. ThegetMessageHash
andisValidSignature
methods are critical for securely verifying signatures on transactions. Any flaws could allow an attacker to bypass policies or spoof signatures to steal funds.Proof of Concept
Here is the key signature validation logic:
In
getMessageHash
: #Line 68-70And in
isValidSignature
:https://github.com/code-423n4/2023-10-brahma/blob/c217699448ffd7ec0253472bf0d156e52d45ca71/contracts/src/core/ConsoleFallbackHandler.sol#L42-L53
The issues here: are
No validation of
_data
ingetMessageHash
- could lead to hash collision vulnerabilities if manipulatedOverly complex hashing logic - room for errors or hash collisions
signedMessages
check doesn't ensure threshold is metThe
getMessageHash
andisValidSignature
methods are critical for securely verifying signatures on transactions. Any flaws could allow an attacker to bypass policies or spoof signatures to steal funds.Some key risks are:
No input validation in
getMessageHash
- an attacker could manipulate_data
to intentionally cause hash collisions, resulting in identical hashes and signatures for different transactions. This defeats the uniqueness property required for security.Overly complex hashing logic - the multi-step hashing and encoding process has a higher risk of implementation bugs or hash collisions compared to a simple hash function. Extra care needs to be taken in review.
Ineffective
signedMessages
check - this only checks if >0 signatures exist, not if the threshold is met. Could allow partial signatures.No checking return values from
checkSignatures
. Failed or errored responses could be missed.These flaws could allow signatures to be reused across different transactions, bypass thresholds, or spoof signatures entirely.
Attackers could bypass policies to steal funds, destroy contracts, etc. Auditing would be hindered since different transactions appear signed by owners.
Let me substantiate the analysis around the signature validation logic risks by pointing to the specific lines of code:
Lack of input validation in
getMessageHash
: 68Overly complex hashing
Weak
signedMessages
check: 43-44Tools Used
Manual Review
Recommended Mitigation Steps
Assessed type
Invalid Validation