forte icon indicating copy to clipboard operation
forte copied to clipboard

Validate deserialized content

Open hunterhector opened this issue 3 years ago • 0 comments

Describe the bug When being deserialized, there is currently no validation of the input. The system doesn't know what's actually in the data. This can make debugging hard, and also pose security threads.

To Reproduce If we provide any jsonpickle compatible content here, they can be decoded:

https://github.com/asyml/forte/blob/master/forte/data/base_pack.py#L211

But then the data is assumed to be a data pack.

Expected behavior Some validation needs to be performed, including but may go beyond:

  1. whether the output of jsonpickle is datapack
  2. whether entries in the data pack are subclasses of entry (This may be done after we polish the serialization system)

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]
  • Python and Package verions: [e.g. Python version, Pytorch version]

Additional context Add any other context about the problem here.

hunterhector avatar Apr 07 '22 23:04 hunterhector