GolomTrader : validateOrder function does not check if ecrecover return value is 0
The validateOrder function in GolomTrader calls ecrecover directly and does not check if the returned address is zero. An attacker could submit an order with an invalid signature that recovers to address zero, making the order appear valid and enabling a griefing attack.
Submitted by cccz, also found by 0x1f8b, 0xHarry, AuditsAreUS, djxploit, jayjonah8, joestakey, and teddav
The validateOrder function of GolomTrader calls the Solidity ecrecover function directly to verify the given signatures. The return value of ecrecover may be 0, which means the signature is invalid, but the check can be bypassed when signer is 0.
Proof of Concept
Recommended Mitigation Steps
Use the recover function from OpenZeppelin’s ECDSA library for signature verification.
Seems invalid or QA at best. No impact on protocol as far as I see, invalid orders from “address 0” will revert. In fillAsk if the
o.signeris address 0, the function will try to pull tokens from address 0 and will fail. In fillBid/criteria, function will try to transfer msg.sender’s tokens to address 0 and pull weth from address 0. So will fail.
This is valid as a medium risk. It opens a griefing attack where a bad actor spams any system that relies on this function. The fact that the fill will fail while the order appears valid is specifically what makes this griefing attack possible.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the contract failed to verify that the address returned by ecrecover was not the zero address.
Impact
This could enable a griefing attack where a bad actor spams the system with orders that appear valid but fail when filled.
What the attacker needed
Ability to submit orders to the contract
The fix
The contract should use OpenZeppelin's ECDSA library for signature verification, which checks for invalid signatures.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a contract checks a digital signature, it uses a function called ecrecover to find out who signed. If the signature is bad, ecrecover can return the special address zero instead of failing. The contract here did not check for that, so a bad signature could look valid and cause problems.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.