🔍 CVE-2023-39532

9.8
CVSS Score
CRITICAL
2023-08-08
2026-06-17 06:12
✅ 완료

🇰🇷 한글 설명

SES(Secure EcmaScript)의 특정 버전에서 컴파트먼트(Compartment) 격리 기능에 결함이 발견되었습니다. 공격자는 스프레드 연산자 뒤에 동적 임포트를 사용하는 방식({...import(...)})을 통해 격리된 환경을 벗어나 호스트 시스템의 모듈에 접근하거나 임의의 코드를 실행할 수 있습니다.

💡 쉬운 설명

안전하게 격리되어 실행되어야 할 프로그램이 보안 벽을 뚫고 컴퓨터의 핵심 기능에 접근할 수 있는 취약점입니다. 특수한 코드를 입력하면 공격자가 허가되지 않은 명령을 실행하거나 정보를 빼낼 수 있습니다.

🇺🇸 원문 (English)

SES is a JavaScript environment that allows safe execution of arbitrary programs in Compartments. In version 0.18.0 prior to 0.18.7, 0.17.0 prior to 0.17.1, 0.16.0 prior to 0.16.1, 0.15.0 prior to 0.15.24, 0.14.0 prior to 0.14.5, an 0.13.0 prior to 0.13.5, there is a hole in the confinement of guest applications under SES that may manifest as either the ability to exfiltrate information or execute arbitrary code depending on the configuration and implementation of the surrounding host. Guest program running inside a Compartment with as few as no endowments can gain access to the surrounding host’s dynamic import by using dynamic import after the spread operator, like `{...import(arbitraryModuleSpecifier)}`. On the web or in web extensions, a Content-Security-Policy following ordinary best practices likely mitigates both the risk of exfiltration and execution of arbitrary code, at least limiting the modules that the attacker can import to those that are already part of the application. However, without a Content-Security-Policy, dynamic import can be used to issue HTTP requests for either communication through the URL or for the execution of code reachable from that origin. Within an XS worker, an attacker can use the host’s module system to the extent that the host has been configured. This typically only allows access to module code on the host’s file system and is of limited use to an attacker. Within Node.js, the attacker gains access to Node.js’s module system. Importing the powerful builtins is not useful except insofar as there are side-effects and tempered because dynamic import returns a promise. Spreading a promise into an object renders the promises useless. However, Node.js allows importing data URLs, so this is a clear path to arbitrary execution. Versions 0.18.7, 0.17.1, 0.16.1, 0.15.24, 0.14.5, and 0.13.5 contain a patch for this issue. Some workarounds are available. On the web, providing a suitably constrained Content-Security-Policy mitigates most of the threat. With XS, building a binary that lacks the ability to load modules at runtime mitigates the entirety of the threat. That will look like an implementation of `fxFindModule` in a file like `xsPlatform.c` that calls `fxRejectModuleFile`.

📍 영향받는 시스템

SES 0.18.0 (0.18.7 미만), 0.17.0 (0.17.1 미만), 0.16.0 (0.16.1 미만), 0.15.0 (0.15.24 미만), 0.14.0 (0.14.5 미만), 0.13.0 (0.13.5 미만)

⚔️ 공격 벡터

스프레드 연산자 뒤에 동적 임포트를 결합한 구문({...import(specifier)})을 사용하여 격리된 컴파트먼트의 경계를 우회함

🛡️ 대응 방법

SES를 패치된 버전(0.18.7, 0.17.1, 0.16.1, 0.15.24, 0.14.5, 0.13.5 이상)으로 업데이트하거나, 웹 환경에서는 엄격한 Content-Security-Policy(CSP)를 적용함

🔧 검증 코드

출력된 결과에서 @endo/ses의 버전을 확인하여 취약한 버전 범위에 해당하는지 체크합니다.

Shell / Script
npm list @endo/ses || yarn list --pattern @endo/ses

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Node.js