Skip to content

Doing a POST with an already existing id will overwrite the old instance #18

@dankrause

Description

@dankrause

Allowing string ids to be POSTed introduced a bug / security hole. When POSTing a new instance, or multiple instances, the id is accepted as is, and is posted over top of the old instance. Since nothing is ever fetched during a post, and that is also when the owner is set, the resulting instance becomes owned by whoever POSTed to it last.

It looks like the only way to safely post with a user-provided id is to first attempt to fetch all objects by id, and reject the request if any of them already exist.

This issue was caused by #11, and still exists in #15. It was noticed while testing a new permissions system (#16).

I can get the fix in with #16, or I can fix it separately. The fix will need to be redone for #16 anyway though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions