snarkVM icon indicating copy to clipboard operation
snarkVM copied to clipboard

[Bug] Remove all slice indexing in `Plaintext` and `Record` from `console` and `circuit`

Open howardwu opened this issue 2 years ago • 0 comments

🐛 Bug Report

Remove all slice indexing in Plaintext and Record from console and circuit.

There are many indices accessed directly instead of calling .get() which can cause unintentional panics (no it is not from poor engineering) when decrypting records that don't belong to the caller.

Note: in the real-world this case will not be hit, as the scanner is designed to first check if .is_owner() before calling .decrypt(). The lack of the owner check in decrypt was originally made to significantly reduce the runtime cost.

howardwu avatar Apr 16 '23 20:04 howardwu