Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

offerArgs not validated #142

Closed
dckc opened this issue Dec 5, 2024 · 1 comment
Closed

offerArgs not validated #142

dckc opened this issue Dec 5, 2024 · 1 comment

Comments

@dckc
Copy link
Collaborator

dckc commented Dec 5, 2024

Per offerArgs docs:

Contract code should be careful interacting with offerArgs. These values need input validation before being used since they are coming directly from the caller and may have malicious behavior.

Malformed or excessively large proofs can lead to performance degradation or bypass validation mechanisms.

Suggestion: use pattern validation, much like proposal shapes

ack: @Jovonni

@tgrecojs
Copy link
Contributor

tgrecojs commented Jan 7, 2025

closing this out as offerArgs validation was implemented in #149

Below is the relevant snippet that now exists in the main branch:

const ProofDataShape = harden({
hash: M.string(),
direction: M.string(),
});
const OfferArgsShape = harden({
tier: M.number(),
key: M.string(),
proof: M.arrayOf(ProofDataShape),
});

@tgrecojs tgrecojs closed this as completed Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants