Skip to content

client code should also valide field inputs #5

@bkomuves

Description

@bkomuves

This is arguably a bug in zerokit, but any case, not only the smart contract, but the client code should also validate field-like inputs; eg. in membership_pda_seed().

Really, one should never ever use bytes to store field elements, apart from dealing with external input / output (use a proper field element type instead, even if in the worst case it's just a newtype wrapper), and only have a single validating conversion function from bytes into the proper type (which gives an error for invalid input).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions