Skip to content

encoding/gob: document or improve handling of untrusted data #20221

Open
@josharian

Description

@josharian

It is pretty easy to construct small malicious encoding/gob packets with large impacts, e.g. by using a large map hint (CL 40113).

I don't see:

  • anything in the encoding/gob docs that discusses safe handling of untrusted data
  • anything in the encoding/gob API that would support checking whether untrusted data is safe to decode
  • anything in the implementation that ensures e.g. that there is a relationship between the amount of data and the memory used; if there were limits on amplification, then a io.LimitedReader could be used

Although maybe I missed something.

It seems like we should add some or all of the above.

cc @bradfitz @gruszczy @randall77 @robpike

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions