Bug Type
Missing owner/type checks
Vulnerable Lines
tests/pyth/programs/pyth/src/lib.rs:23-27
tests/pyth/programs/pyth/src/lib.rs:31-35
tests/pyth/programs/pyth/src/pc.rs:101-109
Root Cause
SetPrice.price is a mutable raw AccountInfo. Price::load borrows account data mutably and casts it into a Price layout without checking owner, account size, discriminator/magic value, or type.
Exploit Way
A caller can provide any writable account with sufficiently shaped data. The handler will reinterpret the bytes as a price account and mutate agg.price; malformed data can also panic via unwrap().
Impact
Unchecked account data can be corrupted or cause instruction failure/DoS in this test program.
Bug Type
Missing owner/type checks
Vulnerable Lines
tests/pyth/programs/pyth/src/lib.rs:23-27tests/pyth/programs/pyth/src/lib.rs:31-35tests/pyth/programs/pyth/src/pc.rs:101-109Root Cause
SetPrice.priceis a mutable rawAccountInfo.Price::loadborrows account data mutably and casts it into aPricelayout without checking owner, account size, discriminator/magic value, or type.Exploit Way
A caller can provide any writable account with sufficiently shaped data. The handler will reinterpret the bytes as a price account and mutate
agg.price; malformed data can also panic viaunwrap().Impact
Unchecked account data can be corrupted or cause instruction failure/DoS in this test program.