Skip to content
This repository was archived by the owner on Sep 30, 2023. It is now read-only.
This repository was archived by the owner on Sep 30, 2023. It is now read-only.

putAll operation index must handle invalid entries #39

@tabcat

Description

@tabcat

https://github.com/orbitdb/orbit-db-docstore/blob/b522ab298f95d9b0ff0e94beb4f5216c374860a5/src/DocumentIndex.js#L16-L26
In the state reducer of docstores updateIndex method, an invalid entry could be maliciously advertised to crash the method. This would likely result in the index state never being able to be update past the malicious entry.
A check should be added that makes sure item.payload.docs is iterable or an array (e.g. item.payload.docs[Symbol.iterator] or Array.isArray(item.payload.docs)).

Metadata

Metadata

Assignees

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