Skip to content

worker: cross-tenant GET/PATCH/DELETE returns 403 — same class as #173/#187 (secure-404) #191

@CryptoJones

Description

@CryptoJones

Problem

Same class of bug as #173 (company) and #187 (billingtype), on the Worker controller. /v1/worker/:id GET/PATCH/DELETE returns 404 for non-existent ids but 403 for ids that exist but belong to a different tenant. Status-code distinction lets a scoped caller enumerate workerId populations across the whole tenant table.

Fix

Collapse both cases into 404 with the same body. Master-key + own-tenant paths unchanged. Tests pin the new behavior on all three handlers.

Acceptance

  • getById: non-master + existing-but-not-yours → 404
  • update: non-master + existing-but-not-yours → 404
  • remove: non-master + existing-but-not-yours → 404
  • Tests in tests/api/worker.test.js pin all three

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

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