Skip to content

tenantsecret registry copies caller-supplied internal.cozystack.io labels into the backing Secret #3464

Description

tenantToSecret (pkg/registry/core/tenantsecret/rest.go:117-119) copies every label from the request into the Secret it writes, with no filtering:

for k, v := range ts.Labels {
    out.Labels[k] = v
}

The registry implements Create, Update and Delete (:219, :334, :382), so the write path is real. What keeps this inert today is that tenant roles grant only get/list/watch on tenantsecrets.

That read-only posture lives in a different package (packages/system/cozystack-basics clusterroles), and the labels in question now decide visibility. internal.cozystack.io/tenantresource is what the aggregated API surfaces on, and internal.cozystack.io/tenant-ca is what the per-app ResourceDefinitions select on. Postgres already ships that selector on main, and #2814 converges more engines onto the same label, so the number of definitions keying off a caller-suppliable label is growing.

The moment any principal gains create on this API, a caller can stamp both labels on a Secret of their choosing.

A deny-list on internal.cozystack.io/* keys in tenantToSecret is the cheap fix, and it is worth having in place before more engines depend on the label. Found while converting qdrant (#3341).

Activity

  1. added
    securitySecurity-related issues and features
    security/highHigh severity security finding
    on Jul 27, 2026
  2. added a commit that references this issue on Sep 1, 2026
    c8d073f
  3. added a commit that references this issue on Sep 7, 2026
    833b2ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    securitySecurity-related issues and featuressecurity/highHigh severity security findingtriage/needs-triageIndicates an issue needs triage by a maintainer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions