Read the docs

Sandbox escape in OpenCTI EJS templates allows server code execution

Priority MEDIUM 53CWE-94Published · Updated

Key facts

Attack vector
Network
Privileges required
Low
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-2w97-6f9j-gr9q. Fix status from GitHub. Impact type from CWE-94.

Summary

OpenCTI from 7.260624.0 before 7.260811.0 and LTS 7.260309.0 before 7.260309.0-lts.6 sandboxes EJS templates with a verifier. A flaw in its comment stripping lets a crafted regular expression literal hide code from the checks while the original template still runs (CWE-94). An authenticated user with CSVMAPPERS, SETTINGS_SETCUSTOMIZATION or SETTINGS_SETACCESSES can execute arbitrary JavaScript on the server.

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

Description from the GitHub advisory

### Summary OpenCTI sandboxes user-authored EJS templates with a verifier (`safeEjs`) that analyzes the template code and rejects dangerous constructs before rendering. A flaw in the verifier's comment-stripping step allows a crafted regular expression literal to hide code from the verifier while the original, unmodified template is still executed. As a result, all verifier checks, including restricted globals, restricted properties, dynamic imports and execution quotas, can be bypassed. An authenticated user who is allowed to create or edit templates can use this to execute arbitrary JavaScript in the platform process, which is not isolated from the rest of the server. This is an incomplete fix of a previous comment-handling bypass (GHSA-2872-rg44-j9gx). ### Impact Arbitrary code execution on the server (CWE-94), CVSS 3.1 **8.8 High**: `AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`. Exploitation requires an account holding at least one of the following capabilities, which allow storing templates that are later rendered: - `CSVMAPPERS` (JSON mapper formulas) - `SETTINGS_SETCUSTOMIZATION` (notifier templates) - `SETTINGS_SETACCESSES` (e-mail templates) Users with no capabilities, the default `KNOWLEDGE` role, and connector tokens were tested and are **not** able to exploit the issue. Service accounts holding one of the capabilities above are affected, including accounts configured for unattended data-integration jobs. Successful exploitation runs code with the privileges of the platform process (root in the default container image). This gives access to everything in the process environment (database, message broker and object storage credentials, SSO secrets, admin token, encryption keys) and network reach into the backend services. This exposes the complete knowledge base and allows tampering with the data. Affected versions: `>= 7.260624.0, < 7.260811.0`, and `< 7.260309.0-lts.6` on the LTS branch. ### Patches Fixed in **7.260811.0**. The template verifier now identifies comments using the JavaScript parser instead of a hand-written scanner. The fix is also backported to the 7.260309.0 LTS branch as **7.260309.0-lts.7**. Users should upgrade to the latest release. ### Workarounds If upgrading is not immediately possible: - Restrict `CSVMAPPERS`, `SETTINGS_SETCUSTOMIZATION` and `SETTINGS_SETACCESSES` to fully trusted users, and review service accounts and API tokens that hold them. - Review stored templates (notifier templates, JSON mapper formulas, e-mail templates) for unexpected content, in particular unusual regular expression literals. Inspect suspicious entries without rendering or testing them. - Check audit logs for template test and render operations from unexpected users.

Why it matters now

Fix Fixed OpenCTI: >= 7.260811.0OpenCTI LTS 7.260309.0: >= 7.260309.0-lts.6

SSVC decision points

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

Affected products

VendorProductAffected versionsFixed inStatusSource
—OpenCTIseems to be >= 7.260624.0, < 7.260811.0>= 7.260811.0Patch availableGHSA-2w97-6f9j-gr9q
—OpenCTI LTS 7.260309.0< 7.260309.0-lts.6>= 7.260309.0-lts.6Patch availableGHSA-2w97-6f9j-gr9q
  • OpenCTI Vendor— Affected seems to be >= 7.260624.0, < 7.260811.0 Fixed in >= 7.260811.0 Patch available GHSA-2w97-6f9j-gr9q
  • OpenCTI LTS 7.260309.0 Vendor— Affected < 7.260309.0-lts.6 Fixed in >= 7.260309.0-lts.6 Patch available GHSA-2w97-6f9j-gr9q

Remediation

Upgrade OpenCTI to 7.260811.0 or later, or upgrade the LTS branch to 7.260309.0-lts.7 or later. If upgrading is not possible, restrict CSVMAPPERS, SETTINGS_SETCUSTOMIZATION and SETTINGS_SETACCESSES to fully trusted users.

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

  • Fix · GHSA-2w97-6f9j-gr9q OpenCTI Fixed in >= 7.260811.0 Advisory →
  • Fix · GHSA-2w97-6f9j-gr9q OpenCTI LTS 7.260309.0 Fixed in >= 7.260309.0-lts.6 Advisory →

Timeline

  1. 2026-11-13 Threatist record created from GHSA-2w97-6f9j-gr9q

References

Sources

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