Skip to content

token-lending: harden Pyth product attr parsing (avoid OOB panic)#223

Open
yukikm wants to merge 4304 commits into
solendprotocol:masterfrom
yukikm:fix-token-lending-pyth-attr-oob
Open

token-lending: harden Pyth product attr parsing (avoid OOB panic)#223
yukikm wants to merge 4304 commits into
solendprotocol:masterfrom
yukikm:fix-token-lending-pyth-attr-oob

Conversation

@yukikm
Copy link
Copy Markdown

@yukikm yukikm commented Feb 14, 2026

This PR hardens parsing of pyth::Product.attr in token-lending to ensure malformed attribute data cannot trigger an out-of-bounds panic.

Changes:

  • Rewrite get_pyth_product_quote_currency with full bounds checks (panic → clean error).
  • Add a unit test that previously would have caused an OOB panic.
  • Add a short write-up: token-lending/program/PYTH_ATTR_PANIC_WRITEUP.md.

Why: On-chain programs should never panic on untrusted account data; panics become deterministic instruction failures (DoS for the affected path).

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.