Skip to content

RBAC: owner usernames and group GIDs share one namespace in requirePermission — owners:["admin"] coincidentally satisfies the admin group #37

@rubenvdlinde

Description

@rubenvdlinde

ApplicationsController::requirePermission() / listMine() build the authorised set with collectAuthorisedGroups() (flatten permissions.owners ∪ editors ∪ viewers) and intersect it with getUserGroupIds($user) (the caller's group GIDs). The two collections live in the same string namespace, so an Application whose permissions.owners contains the literal username "admin" is, by coincidence, also satisfied by anyone in the admin group — and the audited admin-bypass branch (REQ-OBRBAC-006) is never reached for that app.

The seeded hello-world Application has permissions.owners = ["admin"], so in the openbuilt-rbac Newman suite step 3.3 ("admin gets 200 via the bypass") actually returns 200 via the owner match, and step 3.4's rbac.admin_bypass audit row never gets written. The collection now treats that row as informational and links here.

Likely fix: namespace the principals (e.g. group:openbuilt-rbac-editors vs user:alice, or keep owners/editors/viewers as user lists and check membership distinctly from group ACLs), or at minimum document that owners/editors/viewers are group GIDs only and never bare usernames.

Found while fixing the Newman chain collections (#33).

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