Home / Market / marketplace rbac audit

marketplace rbac audit

Audit multi-role marketplace authorization across roles, resource ownership, tenant boundaries, and order-state transitions; use when access rules need evidence, not UI assumptions.

skill★ 509210 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: marketplace-rbac-audit description: "Audit multi-role marketplace authorization across roles, resource ownership, tenant boundaries, and order-state transitions; use when access rules need evidence, not UI assumptions." category: security risk: safe source: self source_type: self date_added: "2026-09-12" author: mosinlshaikh tags: [marketplace, rbac, authorization, access-control, security] tools: [claude, cursor, codex, gemini]

---

Marketplace RBAC Audit

Overview

Audit authorization in marketplaces where customers, vendors, fulfillment staff, couriers, support agents, administrators, and service accounts act on shared orders and resources. Build an explicit policy matrix, trace enforcement from route to data access, and verify both allowed and denied behavior without treating hidden UI controls as security.

This is a read-only review by default. It does not grant permission to scan a live service, create test accounts, alter permissions, or access another person's data.

When to Use This Skill

Do not use this skill for authentication design alone, generic multi-tenant architecture, offensive ID enumeration, or penetration testing outside an explicitly authorized test environment.

Establish the Authorization Contract

Record the actual actors and resources instead of assuming standard role names.

For each actor, capture:

Separate these policy dimensions:

  1. Role — what this actor type may generally do.
  2. Relationship — which specific object the actor may access.
  3. Tenant or operational scope — where the permission applies.
  4. Resource state — whether the operation is valid now.
  5. Field scope — which attributes may be viewed or changed.

A matching role is not sufficient when ownership, assignment, tenant, state, or field rules fail.

Build the Policy Matrix

Create one row per meaningful actor-resource-operation combination.

| Field | Required content | |---|---| | Actor | Role plus relevant tenant/store/hub/assignment | | Resource | Order, product, inventory, payout, address, profile, delivery, refund, or admin object | | Operation | List, view, create, update, delete, assign, transition, refund, export, or impersonate | | Relationship | Owner, seller, assignee, servicing hub, same tenant, or none | | Required state | Order/payment/delivery state in which the operation is allowed | | Field scope | Allowed and prohibited fields | | Expected result | Allow or deny, including disclosure policy such as 403 versus 404 | | Enforcement point | Route, policy layer, service, query predicate, database policy, or queue consumer | | Evidence | Code reference, test ID, request ID, or audit event |

Mark an undocumented decision as UNDEFINED; do not invent a permission merely because current code allows it.

Audit Workflow

1. Inventory Entry Points

Map HTTP routes, GraphQL operations, server actions, background jobs, webhooks, file downloads, exports, administrative tools, and queue consumers that access marketplace resources. Include bulk operations and alternate HTTP methods.

2. Trace Identity and Scope

For every entry point, trace how the authenticated principal becomes an authorization context. Confirm that role, tenant, store, hub, assignment, and delegation claims come from a trusted server-side source and are current enough for the operation.

Do not accept actor, tenant, owner, vendor, hub, courier, price, payout, or privilege fields from the request merely because they are present in a signed-in session.

3. Trace Object Authorization

Follow the resource identifier from request to data access. Prefer a scoped query or atomic mutation that includes every required predicate:

~~~text resource_id + tenant/store/hub scope + owner/seller/assignee relationship + permitted current state = authorized object or no match ~~~

A separate “check then update” sequence may race with reassignment or state changes. Record where a transaction, conditional update, row-level lock, or equivalent consistency control is required.

4. Check Field-Level Authorization

Compare request and response schemas by role. Verify that mass assignment, serializer defaults, ORM spreads, exports, and error payloads cannot expose or change protected fields.

Examples of sensitive fields include:

5. Audit State Transitions

Build an allowlist of valid transitions with authorized actors and invariants. For example, “assigned courier may mark picked up” is incomplete unless the order is assigned to that courier, is in the expected prior state, belongs to the same operational scope, and has not been cancelled.

Reject client-selected final states when the server should derive the transition. Verify idempotency and concurrency behavior for assignment, cancellation, refund, fulfillment, and delivery confirmation.

6. Verify Indirect Paths

Apply the same policy to:

UI visibility is evidence of presentation only. A hidden button, disabled control, or unpublished link does not enforce authorization.

7. Design Negative Tests

Use synthetic identities and records in an authorized test environment. For every important allowed case, add the nearest denied cases:

Do not use real customer records as “victim” data. Do not enumerate identifiers or run live probes without explicit target authorization and a bounded test plan.

8. Report Evidence and Gaps

Report confirmed behavior separately from code inference. A route with no test is not proven secure; mark it NOT VERIFIED. A permission with no owner is UNDEFINED.

Findings Format

~~~text MARKETPLACE RBAC AUDIT Revision: <immutable source revision> Environment: <code review or authorized test target> Observed at: <UTC timestamp>

POLICY COVERAGE: <covered rows>/<required rows> ALLOWED-PATH TESTS: PASS | FAIL | NOT VERIFIED DENIED-PATH TESTS: PASS | FAIL | NOT VERIFIED OBJECT OWNERSHIP: PASS | FAIL | NOT VERIFIED TENANT/STORE/HUB ISOLATION: PASS | FAIL | NOT VERIFIED STATE TRANSITIONS: PASS | FAIL | NOT VERIFIED FIELD-LEVEL ACCESS: PASS | FAIL | NOT VERIFIED INDIRECT PATHS: PASS | FAIL | NOT VERIFIED PRIVILEGED ACTION AUDITABILITY: PASS | FAIL | NOT VERIFIED

OVERALL: PASS | FAIL | INCOMPLETE Findings: <IDs with actor, resource, operation, evidence, and impact> Undefined policies: <explicit list> Untested paths: <explicit list> ~~~

Example Policy Rows

| Actor | Resource and operation | Relationship/state | Expected | |---|---|---|---| | Customer | View order | Own order | Allow | | Customer | View order | Another customer's order | Deny | | Vendor operator | Update product | Product belongs to vendor; editable state | Allow permitted fields only | | Vendor operator | View payout | Different vendor | Deny | | Courier | Update delivery status | Assigned delivery; valid next state | Allow one transition | | Courier | Read customer location | Unassigned or completed delivery | Deny | | Hub operator | Assign courier | Order belongs to serviced hub; assignable state | Allow | | Hub operator | Refund payment | No refund permission | Deny | | Support agent | View order | Active support purpose | Allow redacted fields and audit access | | Administrator | Change user role | Explicit privilege plus required approval | Allow and emit audit event |

Severity Guidance

Base severity on demonstrated reach, sensitivity, prerequisites, and business impact. Do not inflate severity from a role name alone.

Best Practices

Common Pitfalls

Solution: Test the backend operation directly with a synthetic unauthorized principal.

Solution: Require both the role and the resource's vendor/store relationship in the query.

Solution: Authorize one server-defined transition from the current state for the assigned courier.

Solution: Define separate privileged operations, field scope, approval requirements, and audit events.

Solution: Reuse the same policy at every direct and indirect resource path.

Limitations

Security & Safety Notes