ipld/unixfs: Dagreader ignores internal data node when links are present #390
Labels
kind/bug
A bug in existing code (including security flaws)
need/analysis
Needs further analysis before proceeding
P1
High: Likely tackled by core team if no one steps up
Hello!
I'm currently studying a use case for go-ipfs in which a file node contains links to other versions of itself.
This all works well until the root file becomes small enough to fit inside the root's data node. Then, accessing the file through
ipfs cat
or the gateway skips the data node and goes on to read from the child nodes.After investigating the bug, I found that it originated from
go-unixfs
, and especially the dagreader.More precisely, https://github.com/ipfs/go-unixfs/blob/68c015a6f317ed5e21a4870f7c423a4b38b90a96/io/dagreader.go#L175-L179
I already have a fix for this if there is any interest, although it relies on the empirical assumption that we should stop descending through the DAG when we read a node that has named links (
len(node.Links()[0].Name) != 0
).This would also close ipfs/kubo#7190 , which I opened a month ago.
The text was updated successfully, but these errors were encountered: