pyth-network / pyth-client

Client API for on-chain pyth programs
https://pyth.network
Apache License 2.0
169 stars 102 forks source link

Oracle: Make permissions account mandatory for all privileged instructions #388

Closed drozdziak1 closed 10 months ago

drozdziak1 commented 11 months ago

Motivation

During an audit of oracle code, Amin and I discovered that it is still possible to circumvent the new permissions PDA mechanism if you simply don't pass the permissions account. If you as an attacker have control over price/product/mapping private keys, you can use the legacy privkey-based access control, which means the oracle has a significantly larger attack surface than necessary. This change makes the permissions account mandatory and adjusts all affected unit tests.

Summary of changes

Review Highlights