ipfs / ipfs/specs

IPNS Record verification: must check against the name

Open
#545 0 comments 0 reactions 0 assignees View on GitHub
need/triage
Dominant language
HTML
Stars
1.2k
Forks
247
Avg merge
5d 21h
Merged PRs (30d)
4

Description

I'm following this spec: https://specs.ipfs.tech/ipns/ipns-record/#record-verification

An attacker can create a fake IPNS record with a private key created by the attacker, with the corresponding public key in the IpnsEntry.pubKey field, and with a IpnsEntry.signatureV2 created with that private key. Verification code that literally follows the current spec, can end up accepting the fake IPNS record, since the signature in the record is valid for the public key in the record.

To address this security issue, a step should be added to the verification, where the public key from the record (or from any untrusted source) is compared against the IPNS name. If they don't match, verification must fail.

Note that the Go reference implementation currently already appears to be doing this check:

https://github.com/ipfs/boxo/blob/main/ipns/record.go#L724

Contributor guide

No contributing guide indexed for this repository

Research direction

Read the IPNS record verification section in the linked specification, then compare it with the check in boxo's ipns/record.go around line 724. Update the verification requirements to cover matching the record's public key against the IPNS name, and confirm the specification reflects the existing reference implementation behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cryptography, documentation, security
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.