Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

DAG-CBOR: strictly only allow a single top-level CBOR object #268

Merged
merged 1 commit into from
Jun 16, 2020

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Jun 11, 2020

The streaming form of CBOR (3.1) may use back-to-back top-level objects, we should rule this out as a valid form for DAG-CBOR and require a single, explicit top-level object.

Ref: dignifiedquire/borc#47 (comment) (borc doesn't reject this form of data as it inherited from an implementation that handled streaming data and the looseness was left in).

The streaming form of CBOR (3.1) may use back-to-back top-level objects, we
rule this out as a valid form for DAG-CBOR and require a single, explicit
top-level object

Ref: dignifiedquire/borc#47 (comment)
rvagg added a commit to ipld/js-ipld-dag-cbor that referenced this pull request Jun 11, 2020
The streaming form of CBOR (3.1) may use back-to-back top-level objects without
an explicit container and borc will decode this without failure.
`decodeFirst()` will only return the first of these but additional data may
exist but be hidden.

Ref: dignifiedquire/borc#47 (comment)
Ref: ipld/specs#268
rvagg added a commit to ipld/js-ipld-dag-cbor that referenced this pull request Jun 11, 2020
The streaming form of CBOR (3.1) may use back-to-back top-level objects without
an explicit container and borc will decode this without failure.
`decodeFirst()` will only return the first of these but additional data may
exist but be hidden.

Ref: dignifiedquire/borc#47 (comment)
Ref: ipld/specs#268
rvagg added a commit to ipld/js-dag-cbor that referenced this pull request Jun 11, 2020
The streaming form of CBOR (3.1) may use back-to-back top-level objects without
an explicit container and borc will decode this without failure.
`decodeFirst()` will only return the first of these but additional data may
exist but be hidden.

Ref: ipld/js-ipld-dag-cbor#130
Ref: dignifiedquire/borc#47 (comment)
Ref: ipld/specs#268
vmx pushed a commit to ipld/js-ipld-dag-cbor that referenced this pull request Jun 12, 2020
The streaming form of CBOR (3.1) may use back-to-back top-level objects without
an explicit container and borc will decode this without failure.
`decodeFirst()` will only return the first of these but additional data may
exist but be hidden.

Ref: dignifiedquire/borc#47 (comment)
Ref: ipld/specs#268
@rvagg rvagg merged commit aaefd83 into master Jun 16, 2020
@rvagg rvagg deleted the rvagg/cbor-strict-non-streaming branch June 16, 2020 03:41
rvagg added a commit to ipld/js-dag-cbor that referenced this pull request Jun 16, 2020
The streaming form of CBOR (3.1) may use back-to-back top-level objects without
an explicit container and borc will decode this without failure.
`decodeFirst()` will only return the first of these but additional data may
exist but be hidden.

Ref: ipld/js-ipld-dag-cbor#130
Ref: dignifiedquire/borc#47 (comment)
Ref: ipld/specs#268
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants