Skip to content

Add scoping for window.ipfs.name.publish and window.ipfs.key #452

@lidel

Description

@lidel

Problem

  • window.ipfs.name.publish enables sites to publish content to IPNS
  • keys can be listed via ipfs.keys.ls
  • this results in sites being able to publish arbitrary CID under any key
    • v2.2.0 assumes ACL dialog asking for access too ipfs.name.publish and ipfs.keys.ls is enough, shifting responsibility to user

This PoC will use default key and publish under your PeerID:

ipfs.name.publish('/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR', (err, name) => console.log(err, name))

Potential Solutions

  • leave it as-is (shifting responsibility to user does not smell good)
  • fix it: ipfs.keys and ipfs.name.publish should be scoped in a fashion similar to ipfs.files
    • website should not be able to sniff out what keys are in my possession
    • names of keys generated via window.ipfs.key.gen should be prefixed with unique scope and everything that is not in scope should be filtered out in all window.ipfs.keys.*
    • ipfs.name.publish defaults to self key if key name is not provided which means publishing to /ipns/<PeerID>
      • should this behaviour should be left intact? if so, we need to generate a new key just for the current scope and explicitly add it to the call behind the scenes.

cc @alanshaw

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/window-ipfsIssues related to IPFS API exposed on every pagestatus/deferredConscious decision to pause or backlogtopic/securityWork related to security

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions