T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- scripts/linear_json.sh:54
- Finding
- Linear Adapter Exceeds the Assigned-to-Me Data Access Boundary<![CDATA[ ## Vulnerability Details **File Location**: `scripts/linear_json.sh:54-77` **Vulnerability Type**: Excessive data access caused by missing assignee filtering **Risk Level**: Medium ### Vulnerable Code ```bash issues-team) team_id="${1:-}" if [[ -z "$team_id" ]]; then echo "Usage: linear_json.sh issues-team <team_id>" >&2 exit 1 fi # Note: Linear's GraphQL supports querying team by ID. gql "{ team(id: \"$team_id\") { issues(first: 250, filter: { state: { type: { nin: [\\\"completed\\\", \\\"canceled\\\"] } } }) { nodes { id title url updatedAt state { id name type } } } } }" \ | jq -c '{data:{issues:{nodes:(.data.team.issues.nodes // [])}}}' ;; issues-project) project_id="${1:-}" if [[ -z "$project_id" ]]; then echo "Usage: linear_json.sh issues-project <project_id>" >&2 exit 1 fi gql "{ project(id: \"$project_id\") { issues(first: 250, filter: { state: { type: { nin: [\\\"completed\\\", \\\"canceled\\\"] } } }) { nodes { id title url updatedAt state { id name type } } } } }" \ | jq -c '{data:{issues:{nodes:(.data.project.issues.nodes // [])}}}' ;; ``` ### Technical Analysis The declared workflow boundary requires `next` and `autopilot-tick` to consider only work items assigned to the authenticated user. However, both Linear GraphQL queries filter exclusively on workflow state. They request up to 250 non-completed and non-canceled issues across the configured team or project without an assignee constraint. Consequently, `LinearAdapter.fetchSnapshot()` can receive issue metadata belonging to other users, including issue identifiers, titles, URLs, update timestamps, and workflow states. Calls such as setup validation, backlog selection, and autopilot processing invoke this snapshot logic. The authorization token is sent only to Linear's official HTTPS API, which is necessary for the integration. The vulnerability is therefore not credential exfiltration; it is a failure to enforce the narrower, docu ...[truncated 1655 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Query the authenticated Linear viewer and obtain the viewer's stable user ID. 2. Add an explicit assignee filter to both team and project issue queries so only issues assigned to that viewer are returned. 3. Prefer GraphQL variables rather than interpolating identifiers directly into query strings. This also avoids malformed GraphQL or injection risks if configuration identifiers are not trusted. 4. Apply the assignee constraint at the server query layer rather than filtering results only after retrieval, thereby minimizing unnecessary disclosure. 5. Add adapter tests containing issues assigned to the viewer and to other users, and verify that only viewer-assigned issues enter the snapshot. 6. Add integration tests proving that `next` and `autopilot-tick` cannot select another user's issue. 7. Use a Linear token with the narrowest available workspace, team, project, and operation permissions. 8. Consider pagination with a bounded result limit after the assigned-user filter is applied, rather than retrieving a broad fixed set of 250 active issues. ]]>
