Trying to read malformed HAMT sharded directories can cause panics and virtual memory leaks. If you are reading untrusted user input, an attacker can then trigger a panic.
This is caused by bogus "fanout" parameter in the HAMT directory nodes. A workaround is to not feed untrusted user data to the decoding functions.
{
"url": "https://pkg.go.dev/vuln/GO-2023-1557",
"review_status": "REVIEWED"
}{
"imports": [
{
"path": "github.com/ipfs/go-unixfs/hamt",
"symbols": [
"NewHamtFromDag",
"NewShard",
"NewShardValue",
"Shard.EnumLinks",
"Shard.EnumLinksAsync",
"Shard.Find",
"Shard.ForEachLink",
"Shard.Remove",
"Shard.Set",
"Shard.SetLink",
"Shard.Swap",
"Shard.Take",
"makeShard",
"newChilder"
]
}
]
}