Reject Unconsumed Trailing Data in secp256k1 Precompile #448
kocubinski
started this conversation in
SIMD Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
The secp256k1 precompile currently accepts arbitrary trailing data after the offset table. This unconsumed calldata represents a mismatch between what callers construct (typically via
createInstructionWithEthAddress) and how the program interprets the data.While this edge case is documented, it represents a common footgun in the typical single-signature use case. The misalignment is detectable and preventable, so strict input validation should be enforced rather than relying on callers reading the docs.
Proposed Solution
Reject instructions with unconsumed trailing bytes after the offset table.
Implementation approach
Impact
Consensus breaking: Instructions that previously succeeded with trailing data will now fail. This affects:
Benefit: Prevents silent bugs where callers misconstruct instructions without realizing data is being ignored. In the worst case, if inline signature data is being ignored, and the program has not implemented strict inline requirements for the instruction containing the signature data, a malicious attacker could exploit this fact by appending a second instruction with arbitrary signing data, rendering the secp precompile instruction effectively useless.
Beta Was this translation helpful? Give feedback.
All reactions