id: ZSA-2026-002 title: Repository-scoped role satisfies instance-level authorization (?repo= scope confusion) status: published publisher: category: vendor name: Primitive Engineering namespace: https://primitive-engineering.se timeline: - date: "2026-09-02" state: initial-advisory summary: Published. Found by the manufacturer's security review of 2026-09-02. - date: "2026-09-03" state: fix-available summary: Fixed in v0.0.141, where instance-level routes evaluate the global role. - date: "2026-09-26" state: update summary: The residual, the global-role fallback in repository scope, is closed in v0.1.1 (migration 0047). summary: The authorization middleware resolved the caller's role in the scope the request names, and took that scope from the ?repo= query parameter on every route, including routes that are instance-level by nature (user administration, enrollment tokens, forward tokens, organization credentials). An authenticated identity that holds a repository- or organization-level role (a repository owner, or an organization admin whose role a repository inherits) could therefore append ?repo= to an instance-level request and be authorized with its repository role. The review found no path for an anonymous caller, and none for an identity holding no repository or organization role. It was found by reading the middleware; exploitation was not reproduced against a live deployment and is not known to have occurred. severity: text: P0 on the manufacturer's scale (privilege escalation between authorization scopes); no CVSS vector assigned affected: - vendor: Primitive Engineering product: ZeGit Control Plane (z-backend) versions: - version: "0" status: unaffected versionType: semver lessThan: 0.0.134 - version: 0.0.134 status: affected versionType: semver lessThan: 0.0.141 - version: 0.0.141 status: unaffected versionType: semver lessThan: '*' vulnerabilities: - ids: - system: ZeGit security review text: ZR-2026-09-01 title: ?repo= scope confusion on instance-level routes problem_types: - cwe: CWE-863 action: Upgrade the Control Plane to v0.0.141 or later; v0.1.1 or later also closes the residual. Then repeat the audit-chain review described under mitigation for the affected window. mitigation: 'There is no configuration switch: the scope was read from the query string on every route. Until upgraded, grant repository and organization roles only to identities trusted with instance administration, and review the audit chain for owner-tier mutations (enroll.token_issued, user.role_changed, forward_token.issued, org_credential.set) whose actor holds no instance admin role. The hash chain records the acting identity on every such event.' reported_by: Internal, the security review of 2026-09-02 cra_notification: Not applicable; not actively exploited.