-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
ipfs/boxo
#922Labels
kind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)need/maintainer-inputNeeds input from the current maintainer(s)Needs input from the current maintainer(s)
Description
Checklist
- This is a bug report, not a question. Ask questions on discuss.ipfs.tech.
- I have searched on the issue tracker for my bug.
- I am running the latest kubo version or have an issue updating.
Installation method
third-party binary
Version
Kubo version: 0.34.1-Homebrew
Repo version: 16
System version: arm64/darwin
Golang version: go1.24.1
Config
{
"API": {
"HTTPHeaders": {}
},
"Addresses": {
"API": "/ip4/127.0.0.1/tcp/5001",
"Announce": [],
"AppendAnnounce": [],
"Gateway": "/ip4/127.0.0.1/tcp/8080",
"NoAnnounce": [],
"Swarm": [
"/ip4/0.0.0.0/tcp/4001",
"/ip6/::/tcp/4001",
"/ip4/0.0.0.0/udp/4001/webrtc-direct",
"/ip4/0.0.0.0/udp/4001/quic-v1",
"/ip4/0.0.0.0/udp/4001/quic-v1/webtransport",
"/ip6/::/udp/4001/webrtc-direct",
"/ip6/::/udp/4001/quic-v1",
"/ip6/::/udp/4001/quic-v1/webtransport"
]
},
"AutoNAT": {},
"AutoTLS": {},
"Bootstrap": [
"/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
"/ip4/104.131.131.82/udp/4001/quic-v1/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
"/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
"/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
"/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
"/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
"/dnsaddr/va1.bootstrap.libp2p.io/p2p/12D3KooWKnDdG3iXw9eTFijk3EWSunZcFi54Zka4wmtqtt6rPxc8"
],
"DNS": {
"Resolvers": {}
},
"Datastore": {
"BlockKeyCacheSize": null,
"BloomFilterSize": 0,
"GCPeriod": "1h",
"HashOnRead": false,
"Spec": {
"mounts": [
{
"child": {
"path": "blocks",
"shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
"sync": false,
"type": "flatfs"
},
"mountpoint": "/blocks",
"prefix": "flatfs.datastore",
"type": "measure"
},
{
"child": {
"compression": "none",
"path": "datastore",
"type": "levelds"
},
"mountpoint": "/",
"prefix": "leveldb.datastore",
"type": "measure"
}
],
"type": "mount"
},
"StorageGCWatermark": 90,
"StorageMax": "10GB"
},
"Discovery": {
"MDNS": {
"Enabled": true
}
},
"Experimental": {
"FilestoreEnabled": false,
"Libp2pStreamMounting": false,
"OptimisticProvide": false,
"OptimisticProvideJobsPoolSize": 0,
"P2pHttpProxy": false,
"StrategicProviding": false,
"UrlstoreEnabled": false
},
"Gateway": {
"DeserializedResponses": null,
"DisableHTMLErrors": null,
"ExposeRoutingAPI": null,
"HTTPHeaders": {},
"NoDNSLink": false,
"NoFetch": false,
"PublicGateways": null,
"RootRedirect": ""
},
"Identity": {
"PeerID": "12D3KooWA1fJT5L983mE3YcjeQczgKPJxhBURXPooYbeDduKRP7a"
},
"Import": {
"BatchMaxNodes": null,
"BatchMaxSize": null,
"CidVersion": null,
"HashFunction": null,
"UnixFSChunker": null,
"UnixFSRawLeaves": null
},
"Internal": {},
"Ipns": {
"RecordLifetime": "",
"RepublishPeriod": "",
"ResolveCacheSize": 128
},
"Migration": {
"DownloadSources": [],
"Keep": ""
},
"Mounts": {
"FuseAllowOther": false,
"IPFS": "/ipfs",
"IPNS": "/ipns"
},
"Peering": {
"Peers": null
},
"Pinning": {
"RemoteServices": {}
},
"Plugins": {
"Plugins": null
},
"Provider": {
"Strategy": ""
},
"Pubsub": {
"DisableSigning": false,
"Router": ""
},
"Reprovider": {},
"Routing": {
"Methods": null,
"Routers": null
},
"Swarm": {
"AddrFilters": null,
"ConnMgr": {},
"DisableBandwidthMetrics": false,
"DisableNatPortMap": false,
"RelayClient": {},
"RelayService": {},
"ResourceMgr": {},
"Transports": {
"Multiplexers": {},
"Network": {},
"Security": {}
}
},
"Version": {}
}
Description
I encountered this issue while trying to load WACZ files using https://replayweb.page/ ... it uses negative range requests, and Kubo returns the wrong bytes from the file.
Here's a simple example:
$ echo 'abcdef' | ipfs add -
added QmVMajWeL9geiuhkz45Cp7fErqdsD81J1pVKGkUk3KHH6j QmVMajWeL9geiuhkz45Cp7fErqdsD81J1pVKGkUk3KHH6j
7 B / 7 B [=============================================================================================================================================] 100.00%
$ curl -H 'range: bytes=-3' http://127.0.0.1:8080/ipfs/QmVMajWeL9geiuhkz45Cp7fErqdsD81J1pVKGkUk3KHH6j
abc%
Expected output should be: "def" (the last 3 bytes in the file)
Here is the documentation for the Range header from MDN:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Range
The public IPFS gateway (not kubo) works with https://replayweb.page/ -- but it's also returning the wrong bytes (off by one).
$ curl -H 'range: bytes=-3' https://ipfs.io/ipfs/QmVMajWeL9geiuhkz45Cp7fErqdsD81J1pVKGkUk3KHH6j
ef
Faolainlidel
Metadata
Metadata
Assignees
Labels
kind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)need/maintainer-inputNeeds input from the current maintainer(s)Needs input from the current maintainer(s)