A ProtoNode may be modified in such a way as to cause various encode errors which will trigger a panic on common method calls that don't allow for error returns.
Additionally, use of the ProtoNode.SetCidBuilder() method to set non-functioning CidBuilder (such as one that refers to a multihash where an implementation of that hash function is not available) may cause the same methods to panic as a new CID is required but cannot be created.
{
"url": "https://pkg.go.dev/vuln/GO-2022-1155",
"review_status": "REVIEWED"
}{
"imports": [
{
"path": "github.com/ipfs/go-merkledag",
"symbols": [
"ProtoNode.AddNodeLink",
"ProtoNode.AddRawLink",
"ProtoNode.AsBool",
"ProtoNode.AsBytes",
"ProtoNode.AsFloat",
"ProtoNode.AsInt",
"ProtoNode.AsLink",
"ProtoNode.AsString",
"ProtoNode.Cid",
"ProtoNode.EncodeProtobuf",
"ProtoNode.IsAbsent",
"ProtoNode.IsNull",
"ProtoNode.Kind",
"ProtoNode.Length",
"ProtoNode.ListIterator",
"ProtoNode.Loggable",
"ProtoNode.LookupByIndex",
"ProtoNode.LookupByNode",
"ProtoNode.LookupBySegment",
"ProtoNode.LookupByString",
"ProtoNode.MapIterator",
"ProtoNode.Marshal",
"ProtoNode.Multihash",
"ProtoNode.RawData",
"ProtoNode.SetCidBuilder",
"ProtoNode.SetLinks",
"ProtoNode.Size",
"ProtoNode.Stat",
"ProtoNode.String",
"ProtoNode.UnmarshalJSON",
"ProtoNode.UpdateNodeLink",
"ProtoNode.marshalImmutable"
]
}
]
}