Summary
Crabbox prior to v0.12.0 contains an authorization flaw that allows users with visibility-only access to request Code, WebVNC, and Egress agent tickets from specific lease ticket endpoints.
By abusing insufficient access control checks on these endpoints, an attacker can obtain bridge-agent tickets and impersonate trusted lease-side bridges, effectively escalating their privileges far beyond the intended read-only role.
Affected context
This vulnerability affects Crabbox deployments where:
- Users can be granted "visibility-only" access to leases or shared resources.
- The application exposes ticket-issuing endpoints such as:
POST /v1/leases/:id/code/ticketPOST /v1/leases/:id/webvnc/ticketPOST /v1/leases/:id/egress/ticket- Bridge-agent tickets are used to authenticate code, WebVNC, or egress sessions on behalf of a lease.
In such environments, the backend performs insufficient authorization checks for ticket creation, allowing users with limited permissions to obtain powerful agent tickets tied to leases they can only view.
Exploit preconditions
- Attack surface: HTTP API for Crabbox ticket endpoints.
- Required access: A valid user account with at least visibility-only permissions to a target lease or shared resource.
- Trigger point: Sending crafted
POSTrequests to: /v1/leases/:id/code/ticket/v1/leases/:id/webvnc/ticket/v1/leases/:id/egress/ticket- Why exploitation is possible: The backend checks that the caller can see the lease but fails to enforce that they possess the higher privileges normally required to request bridge-agent tickets. This gap in authorization logic (CWE-639) lets low-privilege users access functionality intended only for trusted bridge or editor roles.
Why this happens
The core issue is an improper authorization check on sensitive ticket-issuing endpoints.
Instead of verifying that the requester holds the specific role or capability needed to create bridge-agent tickets (e.g., "controller," "editor," or "bridge"), the system appears to treat visibility access as sufficient or fails to distinguish read-only from operational permissions.
This aligns with CWE-639: Authorization Bypass Through User-Controlled Identifier, where a user can access functionality tied to resource identifiers (:id) without adequate permission checks.
Conceptually, the API allows "who can view" to become "who can act on behalf of" the lease, collapsing the separation between observation and control.
Potential impact
- Attackers with visibility-only access could obtain Code agent tickets and run or influence code where they should only have read access.
- Malicious users can acquire WebVNC tickets and interact with remote desktops or terminals as if they were trusted operators.
- Unauthorized fetching of Egress agent tickets may enable outbound connections, data exfiltration, or network pivoting from the lease environment.
- Impersonation of lease-side bridge agents, undermining trust boundaries between management components and worker environments.
- Lateral movement within the environment by abusing tickets tied to other users' leases.
General mitigation guidance
Effective mitigation for this class of issue centers on strict, role-aware authorization around sensitive endpoints:
- Ensure ticket-issuing endpoints require explicit capabilities (e.g., "create_code_ticket", "create_webvnc_ticket", "create_egress_ticket") rather than reusing generic "can view lease" checks.
- Implement clear separation of permissions between visibility-only, interactive control, and bridge/agent roles; access to resource metadata should not imply access to session or ticket APIs.
- Prefer a centralized authorization layer or policy engine that is consulted consistently for every sensitive route, instead of scattered ad-hoc checks.
- Apply the principle of least privilege to bridge-agent tickets: scope them to specific actions, leases, and time windows and avoid overbroad tokens.
- Design APIs so that identifiers (like
:id) alone never determine permission; all actions should be gated by authenticated identity plus policy-based authorization.
How teams detect issues like this
To detect and monitor for vulnerabilities like this:
- Static analysis and code review:
- Look for handlers serving
/v1/leases/:id/*/ticketor similar endpoints that issue tokens or tickets and verify they call centralized authorization checks. - Flag patterns where permission checks only verify "can view" or "is member" without checking action-specific privileges.
- Review for direct use of path parameters (e.g.,
:id) to fetch resources without subsequent role/capability validation. - Security testing:
- Include authorization-focused tests (positive and negative) for all ticket and token issuance endpoints, making sure visibility-only accounts cannot obtain operational tickets.
- Use API fuzzing or integration tests to iterate over leases and roles, confirming that permission downgrades are respected.
- Operational monitoring:
- Log all ticket issuance events with the requesting user, lease ID, ticket type, and associated roles, then alert on unusual patterns (e.g., read-only users obtaining interactive tickets).
- Periodically audit access logs to ensure that ticket creation aligns with expected roles and workflows.
- Automated security review tools or API gateways with policy enforcement can help surface missing authorization rules before deployment.

