Skip to content

IPNS Record verification: must check against the name #545

Description

@cornwarecjp

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    need/triageNeeds initial labeling and prioritization

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions