CVE-2023-39532

9.8 CRITICAL

📋 TL;DR

CVE-2023-39532 is a critical vulnerability in SES (Secure ECMAScript) that allows guest programs running in Compartments to bypass confinement and access the host's dynamic import functionality. This can lead to information exfiltration or arbitrary code execution depending on the environment configuration. Affected users include those running SES versions 0.13.0-0.18.0 without proper Content-Security-Policy controls.

💻 Affected Systems

Products:
  • SES (Secure ECMAScript)
Versions: 0.13.0 to 0.13.4, 0.14.0 to 0.14.4, 0.15.0 to 0.15.23, 0.16.0 to 0.16.0, 0.17.0 to 0.17.0, 0.18.0 to 0.18.6
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability manifests differently based on environment: web browsers, Node.js, XS workers, or web extensions.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise through arbitrary code execution, allowing attackers to exfiltrate sensitive data, install malware, or pivot to other systems.

🟠

Likely Case

Information exfiltration through HTTP requests to attacker-controlled domains, potentially leaking session tokens, credentials, or application data.

🟢

If Mitigated

Limited impact with proper Content-Security-Policy restricting module imports to trusted origins only.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploit uses simple JavaScript syntax: {...import(arbitraryModuleSpecifier)}. Attackers can leverage dynamic import to bypass confinement.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.18.7, 0.17.1, 0.16.1, 0.15.24, 0.14.5, 0.13.5

Vendor Advisory: https://github.com/endojs/endo/security/advisories/GHSA-9c4h-3f7h-322r

Restart Required: Yes

Instructions:

1. Update SES package to patched version using npm update @endo/ses or yarn upgrade @endo/ses. 2. Restart application/service. 3. Verify version matches patched release.

🔧 Temporary Workarounds

Content-Security-Policy (Web)

all

Implement strict CSP to restrict dynamic imports to trusted origins only.

Content-Security-Policy: script-src 'self'; connect-src 'self'

XS Runtime Module Restriction

linux

Build XS binary without runtime module loading capability by implementing fxFindModule to call fxRejectModuleFile.

🧯 If You Can't Patch

  • Implement strict Content-Security-Policy headers for web applications
  • Isolate SES compartments in sandboxed environments with network restrictions

🔍 How to Verify

Check if Vulnerable:

Check package.json for SES version or run: npm list @endo/ses | grep @endo/ses

Check Version:

npm list @endo/ses | grep @endo/ses

Verify Fix Applied:

Verify installed version is 0.18.7, 0.17.1, 0.16.1, 0.15.24, 0.14.5, or 0.13.5

📡 Detection & Monitoring

Log Indicators:

  • Unexpected dynamic import patterns in JavaScript execution logs
  • Unusual HTTP requests from application to external domains

Network Indicators:

  • Outbound connections to unexpected domains following dynamic import patterns
  • Data exfiltration via URL parameters

SIEM Query:

source="application_logs" AND ("dynamic import" OR "import(") AND NOT domain IN [trusted_domains]

🔗 References

📤 Share & Export