Skip to content

Validate size in the DagReaders #4540

@Stebalien

Description

@Stebalien

When reading files, we should always validate the size (it doesn't look like it currently does). If we ever hit a chunk that's too large, we should truncate it. If we ever hit a chunk that's too small, we should return zeros (allowing holes in files is actually quite useful). We should also document this in a spec somewhere.

Expected size not matching the actual size of something tends to lead to security problems...

@diasdavid objections? How does js-ipfs deal with this issue?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions