IPNS Record verification: must check against the name

Open
#545 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

Description

need/triage

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

Dominant language
HTML
Stars
1.2k
Forks
250
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ipfs/specs

All issues in ipfs/specs

Similar issues

More Cryptography issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.