oxidecomputer / oxidecomputer/omicron

PUT resource policy does not validate type or existence of identity IDs

Open
#1,246 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

I've been using the system users from /users to test role assignment on orgs and projects because I can't list silo users yet (#1235). It just occurred to me that I should not be able to assign resource roles to system users! Here is the PUT body:

image

It seems that as long as I say identity_type: "silo_user", the API does not validate that that is true.

https://github.com/oxidecomputer/omicron/blob/0588fac574963a9380313447bb90e1f2eda88cc5/nexus/src/db/datastore.rs#L3761-L3785

Contributor guide

Open the contributing guide

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.

Research direction

Start in nexus/src/db/datastore.rs around lines 3761-3785 and trace the PUT resource-policy handling. Check how identity_type and identity IDs are validated, then verify the behavior for mismatched system-user types and nonexistent IDs; done means invalid assignments are rejected rather than accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, authorization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.