I hope I'm not adding to the confusion because I am not an expert.
does the oracle in this specific case use external data? and combine that with internal / blockchain inputs? how does one sanitize all those inputs?
are oracles transactional, ie if you manage to alter the state of an oracle within a contract’s transaction, other transactions don’t get any “dirty reads” from the oracle, etc?
The obvious problem is that if that data is manipulated somehow, the smart contract can potentially execute with malicious information.
So in this case someone wrote a smart contract/stored procedure that:
- loan $a_lot_of_money from $defi_a
- do something with $a_lot_of_money to confuse an oracle (e.g. a price feed)
- exploit $defi_b who relies on above oracle data
- return $a_lot_of_money to $defi_a
This all happens in a single "db transaction" so as long as $defi_a receives its money back the tx is going to pass.
If $defi_b relies on an oracle that takes it's data from on-chain, and thus is manipulatable with $a_lot_of_money, it is suspectible to those attacks.
To counteract this, $defi_b could only rely on oracles that are secure against manipulation from $a_lot_of_money, but they don't always exist.
This mechanism can be used for good (riskless arbitrage across decentralized exchange) or for bad exploits.
Chainlink uses a proof a stake (POS) concept where it calls out to a number of LINK nodes that have staked assets for liability in order to win rewards. With all of the Oracles data it goes through an algorithm, for simplicity, let's say the average of all the prices it received, gives the nodes a reputation score, on top of that it uses the reputation of the nodes to choose who ultimately fulfills the request, the number of tokens staked will also take into account. If reputation starts going negative, they could lose the tokens they have staked.