Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-39980

CVE-2026-39980: OpenCTI RCE Vulnerability

CVE-2026-39980 is a remote code execution vulnerability in OpenCTI that allows users with Manage customization capability to execute arbitrary JavaScript. This post covers technical details, affected versions, and mitigation.

Published:

CVE-2026-39980 Overview

CVE-2026-39980 is a critical code injection vulnerability affecting OpenCTI, an open source platform for managing cyber threat intelligence knowledge and observables. The vulnerability exists in the safeEjs.ts file, which does not properly sanitize EJS (Embedded JavaScript) templates. This allows users with the "Manage customization" capability to execute arbitrary JavaScript code within the context of the OpenCTI platform process during notifier template execution.

Critical Impact

Authenticated attackers with elevated privileges can achieve remote code execution on the OpenCTI server, potentially compromising the entire threat intelligence platform, exfiltrating sensitive intelligence data, or using the compromised system as a pivot point for further attacks.

Affected Products

  • OpenCTI versions prior to 6.9.5

Discovery Timeline

  • April 9, 2026 - CVE-2026-39980 published to NVD
  • April 9, 2026 - Last updated in NVD database

Technical Details for CVE-2026-39980

Vulnerability Analysis

This vulnerability stems from improper neutralization of special elements used in a template engine (CWE-1336). The safeEjs.ts component in OpenCTI is designed to provide safe EJS template rendering, but it fails to adequately sanitize user-supplied template content before execution.

EJS templates allow embedding JavaScript code within delimiters such as <% %> for control flow and <%= %> for output. When the sanitization mechanisms in safeEjs.ts are bypassed, an attacker can inject malicious JavaScript that executes server-side within the Node.js runtime environment of the OpenCTI platform.

The vulnerability specifically manifests during notifier template execution, where customized notification templates are processed. While exploitation requires the "Manage customization" capability, this privilege level is typically granted to administrators and power users who manage platform configurations.

Root Cause

The root cause is insufficient input validation and sanitization in the EJS template processing logic within safeEjs.ts. The file fails to properly escape or filter dangerous JavaScript constructs before template compilation and execution. This allows crafted template content to break out of the intended template context and execute arbitrary code.

Attack Vector

The attack is network-based and requires authentication with specific privileges. An attacker must first obtain access to an OpenCTI account with the "Manage customization" capability. Once authenticated, the attacker can navigate to the notifier template configuration interface and inject malicious JavaScript code into a template field.

When the crafted template is executed (such as when a notification is triggered), the injected JavaScript runs in the context of the OpenCTI Node.js process. This grants the attacker the ability to execute system commands, access sensitive files, establish reverse shells, or perform any action the OpenCTI process has permissions to perform.

The exploitation flow involves: accessing the customization interface, crafting a malicious EJS template payload that bypasses the sanitization in safeEjs.ts, saving the template, and triggering template execution through the notifier system.

Detection Methods for CVE-2026-39980

Indicators of Compromise

  • Unexpected modifications to notification templates containing JavaScript code constructs
  • Unusual process spawning from the OpenCTI Node.js process
  • Network connections originating from the OpenCTI server to unknown external hosts
  • Log entries indicating template execution errors or unexpected JavaScript execution

Detection Strategies

  • Monitor audit logs for changes to notification templates, especially by users with the "Manage customization" capability
  • Implement file integrity monitoring on OpenCTI configuration files and template storage locations
  • Deploy network monitoring to detect anomalous outbound connections from the OpenCTI server
  • Review application logs for template rendering errors or stack traces indicating code injection attempts

Monitoring Recommendations

  • Enable verbose logging for the OpenCTI platform to capture template execution events
  • Configure alerting on any template modifications made outside of scheduled maintenance windows
  • Implement runtime application self-protection (RASP) solutions capable of detecting and blocking code injection attempts
  • Monitor system resource utilization for signs of cryptocurrency mining or other resource abuse

How to Mitigate CVE-2026-39980

Immediate Actions Required

  • Upgrade OpenCTI to version 6.9.5 or later immediately
  • Review audit logs for any suspicious template modifications made prior to patching
  • Audit user accounts with the "Manage customization" capability and revoke unnecessary permissions
  • Inspect existing notification templates for malicious code injection indicators

Patch Information

OpenCTI has released version 6.9.5 which addresses this vulnerability by implementing proper sanitization in the safeEjs.ts file. The patch ensures that EJS templates are correctly sanitized before execution, preventing arbitrary JavaScript code injection. Refer to the GitHub Release 6.9.5 for download and upgrade instructions. For full technical details, see the GitHub Security Advisory GHSA-jv9r-jw2f-rhrf.

Workarounds

  • Restrict the "Manage customization" capability to only essential personnel until patching is complete
  • Implement network segmentation to limit the blast radius if the OpenCTI server is compromised
  • Deploy a Web Application Firewall (WAF) with rules to detect common template injection patterns
  • Consider temporarily disabling custom notification templates if they are not critical to operations

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.