🔍 CVE-2026-120338

10.0
CVSS Score
CRITICAL
2026-11-01
2026-11-02 20:17
✅ 완료

🇰🇷 한글 설명

Prefab UI의 Generative UI 샌드박스는 Deno 서브프로세스 안의 Pyodide(WebAssembly 기반 Python)에서 호출자가 제공한 Python 코드를 실행합니다. 0.14.0부터 0.20.2까지 런처가 Deno에 무제한 --allow-read, --allow-write, --allow-net 권한을 부여하고 Deno API를 JavaScript 전역 객체에 남겨두어, 샌드박스 안의 Python이 Deno.readTextFileSync와 Deno.writeTextFileSync로 서버 파일을 읽고 쓸 수 있습니다. 0.21.0에서 런타임 로드 후 파일 읽기/쓰기 및 네트워크 권한을 철회하고 --no-prompt를 적용하며 부트스트랩 네트워크를 cdn.jsdelivr.net으로 제한해 수정되었습니다.

💡 쉬운 설명

외부에서 보낸 코드가 서버 안에서 실행되는 격리 기능이 실제로는 격리되지 않아, 공격자가 서버의 파일을 읽고 쓸 수 있었습니다. 이를 이용하면 서버에 지속적으로 코드를 심어 계속 실행시킬 수 있습니다.

🇺🇸 원문 (English)

Prefab UI's Generative UI sandbox runs caller-supplied Python inside Pyodide, Python compiled to WebAssembly, in a Deno subprocess. The feature is documented as isolation for untrusted code, including LLM-written UI. From prefab-ui 0.14.0 through 0.20.2 the launcher starts Deno with unrestricted --allow-read, --allow-write, and --allow-net, and the runner leaves the Deno API on the JavaScript global object. Pyodide's js module proxies that global, so the Python can call Deno.readTextFileSync and Deno.writeTextFileSync. A caller who can supply the code can read and write files as the server OS user, and can persist code execution by writing a .pth file into the server virtualenv's site-packages. The usual remote path is FastMCP's GenerativeUI provider, which registers the MCP tool generate_prefab_ui and forwards that tool's code argument into this sandbox. On a FastMCP server with no authentication configured, any client who can reach the server can call the tool. With authentication, any client allowed to call tools can. Generative UI is opt-in, and the host must have Deno installed. Confirmed on prefab-ui 0.20.2. Fixed in 0.21.0: after the runtime and Prefab sources load, the runner revokes Deno read, write, and network permission before it accepts code, the process is started with --no-prompt so a permission request cannot grant them again, and bootstrap network access is limited to cdn.jsdelivr.net. The fix is commit 030f074 (pull request 538).

📍 영향받는 시스템

prefab-ui 0.14.0 ~ 0.20.2 (Generative UI 기능 사용 및 Deno 설치 환경, 인증 없는 FastMCP 서버에서 특히 위험)

⚔️ 공격 벡터

generate_prefab_ui MCP 도구의 code 인자로 악성 Python 코드를 전송해 Deno API를 통해 서버 파일을 읽고 쓰며 site-packages에 .pth 파일을 작성해 지속성을 확보

🛡️ 대응 방법

prefab-ui를 0.21.0 이상으로 업그레이드하고, 해당 기능을 사용하지 않는다면 Generative UI를 비활성화하며, MCP 서버에 인증을 설정합니다.

🔧 검증 코드

출력된 버전이 0.14.0 이상 0.20.2 이하이면 취약하므로 즉시 0.21.0 이상으로 업그레이드해야 하며, 명령이 아무것도 출력하지 않으면 설치되지 않은 것입니다.

Shell / Script
pip show prefab-ui 2>/dev/null | grep -i '^version'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

💻 영향받는 소프트웨어

Oracle Java SE