`LLMOracleRegistry` allows users to register as oracles without actually staking tokens (though not intended) and subsequently withdraw tokens they never deposited. This potentially draining the contract of all its tokens or creating large amounts of unauthorized token approvals.
The register function fails to properly validate the success of token transfers:
The boolean return value of transferFrom is not checked, allowing the function to proceed even if the transfer fails.
User calls register() with a token that fails silently
Contract records the stake in registrations without actually receiving tokens
User calls unregister()
Contract approves the user to spend tokens it doesn't actually possess:
Registering without staking if token transfer fails and then unregistering to gain token approvals.
**The user **can drain the contract funds since the contract approves the user to spend them.
The user can register as a Validator or a Generator thus allowing them to bypass the modifier onlyRegistered in LLMOracleCoodinator
the poc is written in foundry so you need to install foundry
run curl -L https://foundry.paradigm.xyz | bash
then foundryup
since this is a hardhat base project you might want to run this in the directory forge init --force
then save the below code into YOURTEST.t.solfile
then run forge test --match-path YOUR-PATH -vvvvv
Manual Review
Validate the return value
Check whether the contract recieves the amount
```
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.