Read the docs

Sandbox escape in OpenCTI safeEjs lets authenticated users run code

Priority MEDIUM 54CWE-94Published · Updated

Key facts

Attack vector
Network
Privileges required
High
User interaction
None
Attack complexity
Low
Impact type
Code execution
Confidentiality · integrity · availability
High · High · High
Fix status
Fixed

Attack profile from CVSS 3.1 · GHSA-2872-rg44-j9gx. Fix status from GitHub. Impact type from CWE-94.

Summary

OpenCTI before 7.260811.0 is affected. The safeEjs sandbox that checks notifier templates ignores code that follows a comment, so the hidden code is still compiled and run by EJS (CWE-94). An authenticated user with the Manage customization capability can run arbitrary code and OS commands on the OpenCTI server by saving a malicious notifier template.

Written with Claude Haiku 5.5 from the sources below · 2026-11-12

Description from the GitHub advisory

## Summary A sandbox escape in the safeEjs EJS template engine allows an authenticated user with the `Manage customization` capability (`SETTINGS_SETCUSTOMIZATION`) to execute arbitrary code and OS commands on the OpenCTI server by saving a malicious notifier template. This vuln is similar to https://github.com/OpenCTI-Platform/opencti/security/advisories/GHSA-jv9r-jw2f-rhrf. ## Details OpenCTI renders notifier templates server-side with EJS, wrapped in a sandbox (safeEjs) that should block dangerous code. https://github.com/OpenCTI-Platform/opencti/blob/1decae3f941116a9556a977e5c0758c9b03ba060/opencti-platform/opencti-graphql/src/utils/safeEjs.ts#L156-L240 `extractEJSCode()` does not account for comments and concatenates scriptlet fragments using `fragments.join('')` without inserting line breaks. As a result, a `//` comment can cause the verifier to ignore the following code, allowing it to pass unchecked. The hidden code is then executed by `ejs.render()`. ```javascript // https://github.com/mde/ejs/blob/main/lib/esm/ejs.js#L871-L875 switch (this.mode) { // Just executing code case Template.modes.EVAL: this.source += ' ; ' + line + '\n'; break; ``` EJS compiles each scriptlet onto its own source line. Therefore, code hidden from the verifier by a `//` comment is still compiled and executed by `ejs.render()`. ## Impact Any user with the `Manage customization` capability (`SETTINGS_SETCUSTOMIZATION`) can run arbitrary code and OS commands in the platform process.

Why it matters now

Fix Fixed OpenCTI: >= 7.260811.0

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—OpenCTI< 7.260811.0>= 7.260811.0Patch availableGHSA-2872-rg44-j9gx
  • OpenCTI Vendor— Affected < 7.260811.0 Fixed in >= 7.260811.0 Patch available GHSA-2872-rg44-j9gx

Remediation

Upgrade OpenCTI to version 7.260811.0 or later.

Written with Claude Haiku 5.5 from the sources below · 2026-11-12

  • Fix · GHSA-2872-rg44-j9gx OpenCTI Fixed in >= 7.260811.0 Advisory →

Timeline

  1. 2026-11-12 Threatist record created from GHSA-2872-rg44-j9gx

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences