Skip to content

Deprecate .add_pyobj() & .get_pyobj()? #96

@ntninja

Description

@ntninja

Looking at the current README, I just noticed this passage:

This module also contains some helper functions for adding strings, json, and even python objects to IPFS:

>>> lst = [1, 77, 'lol']
>>> api.add_pyobj(lst)
'QmRFqz1ABQtbMBDfjpMubTaginvpVnf58Y87gheRzGfe4i'
>>> api.get_pyobj(_)
[1, 77, 'lol']

What this doesn't mention unfortunately is that doing that .get_pyobj() on a hash from an untrusted source = remote code execution. Our documentation does mention this, but even that passage doesn't properly show the magnitude of the problem.

What definitely has to happen:

  • Replace the example with an example showing JSON serialization instead

What we may also want to do:

  • Deprecate the .get_pyobj() and .add_pyobj() function and remove them for good in 0.5.x

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions