Skip to content

fix: throw on CID.parse v0 string with multibase prefix - #241

Merged
rvagg merged 1 commit into
masterfrom
error-cid-v0-with-multibase
Jan 18, 2023
Merged

rvagg merged 1 commit into
masterfrom
error-cid-v0-with-multibase

Conversation

@olizilla

@olizilla olizilla commented Jan 17, 2023 •

Copy link
Copy Markdown
Contributor

Add a check to CID.parse to throw on a CID v0 string with explict multibase, e.g. zQmPr755CxWUwt39C2Yiw4UGKrv16uZhSgeZJmoHUUS9TSJ

the multibase of the string representation is always base58btc and implicit (not written)
– https://github.com/multiformats/cid#versions

We're seeing pinning service requests comming in from the wild with the undesriable multibase prefix, and the expectation was that CID.parse would have thrown and spared us from having to deal with them.

Fixes: #240
See also: ipfs/kubo#9556

License: MIT
Signed-off-by: Oli Evans oli@protocol.ai

Add a check to CID.parse to throw on a CID v0 string with explict multibase, e.g. `zQmPr755CxWUwt39C2Yiw4UGKrv16uZhSgeZJmoHUUS9TSJ`

We're seeing pinning service requests comming in from the wild with the undesriable multibase prefix, and the expectation was that CID.parse would have thrown and spared us from having to deal with them.

Fixes: #240
See also: ipfs/kubo#9556

License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
@olizilla
olizilla requested a review from Gozala January 17, 2023 16:06
@rvagg
rvagg merged commit 258a0be into master Jan 18, 2023
@rvagg
rvagg deleted the error-cid-v0-with-multibase branch January 18, 2023 06:17
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 11.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

What to do with multibase prefixed cid v0 string

3 participants