CVE-2023-39532: SES - Server-Side Template Injection
- Cve: CVE-2023-39532
- Name: SES - Server-Side Template Injection
- Description: 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`.
- Impact: Attackers can exfiltrate data or execute arbitrary code within the host environment, leading to potential full system compromise.
- Remediation: Update to patched versions 0.18.7, 0.17.1, 0.16.1, 0.15.24, 0.14.5, or 0.13.5. Implement Content-Security-Policy and restrict module loading capabilities.
- Vulnerability type: template_injection
- Vulnerability impact: information_disclosure, remote_code_execution
- Requirement type: none
- Labels source: projectdiscovery
- Severity: critical
- Cvss score: 9.8
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Epss score: 0.01349
- Epss percentile: 0.72208
- Assignee: [email protected]
- Published at: 2023-08-08T17:15:09Z
- Age in days: 1204
- Modified at: 2026-06-17T06:12:32Z
- Patch available: yes
- Public exploits total: 1
- References total: 2
- Products total: 1
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2023-39532
- Nvd status: modified
- Checked, none or zero: known exploited entries, nuclei templates, public exploits capped, rejected by nvd
- Not known: requirements
Cwe
| Id | Name |
|---|---|
| CWE-20 | Improper Input Validation |
| NVD-CWE-noinfo | — |
Hackerone
- Reports: 1
- Rank: 5211
Public exploits
| Url | Source | Added date |
|---|---|---|
| https://github.com/endojs/endo/security/advisories/GHSA-9c4h-3f7h-322r | nvd | 2023-08-08 |
References
| Url | Source | Tags |
|---|---|---|
| https://github.com/endojs/endo/commit/fc90c6429604dc79ce8e3355e236ccce2bada041 | nvd | Patch |
| https://github.com/endojs/endo/security/advisories/GHSA-9c4h-3f7h-322r | nvd | Exploit, Patch, Vendor Advisory |
Products
| Product | Affected | Platform bound | Sources | Url |
|---|---|---|---|---|
| agoric:ses | >= 0.18.0, < 0.18.7; = 0.17.0; = 0.16.0; >= 0.15.0, < 0.15.24; >= 0.14.0, < 0.14.5; >= 0.13.0, < 0.13.5 | no | nvd | /v1/products/agoric/ses |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| endojs/endo | commit, fix, package, security_advisory | yes | /v1/repositories/endojs/endo |
Index
- Repositories: 1
- Packages: 1
- Checked, none or zero: repositories high signal
Exploitation
- Public exploit: yes
- Public exploit count: 1
- Public exploit first date: 2023-08-08
- Remote: yes
- Hackerone reports: 1
- Checked, none or zero: known exploited, known exploited by, exploitation seen, initial access, authentication required
- Not known: known exploited since, vulncheck known exploited since, nuclei template, initial access since, exposed hosts