/

CVE-2020-37041

Severity:

HIGH RISK

(7.5)

Directory Traversal in OpenCTI static/css File Serving

CVE-2020-37041

Analyzed

Vulnerability type

Category:

Directory Traversal

CWE:

CWE-22

Impact:

Arbitrary File Read

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenCTI 3.3.1 contains a directory traversal vulnerability in the static/css endpoint that allows crafted URLs with path traversal sequences (such as '../') to escape the intended directory.

An unauthenticated attacker can use this behavior to read arbitrary files from the underlying filesystem, exposing sensitive system and application data when the service is reachable over the network.

Affected context

This vulnerability occurs in OpenCTI 3.3.1 when static assets are served from the /static/css path without properly constraining the requested file path to the intended directory.

The issue is relevant when:

  • The OpenCTI instance is exposed over HTTP/HTTPS
  • The static file handler derives filesystem paths directly from user-controlled URL segments
  • Path traversal sequences (e.g., ../) are not normalized, validated, or rejected before file access

On affected systems, both Linux and Windows files may be accessible if the process has read permissions to the targeted paths.

Exploit preconditions

  • Attack surface: Network-exposed HTTP(S) interface on the OpenCTI application
  • Required access: None; the attack can be performed by unauthenticated, remote users
  • Trigger point: GET requests to the /static/css endpoint with crafted path segments containing directory traversal sequences (e.g., ../)
  • Why exploitation is possible: The server-side logic constructs filesystem paths from user-controlled URL components without enforcing a strict root directory or performing robust normalization and validation, enabling paths that resolve outside the intended static content directory.

Why this happens

The underlying issue maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

The file-serving component takes user-supplied path fragments from the request URL under /static/css and directly translates them into filesystem paths, likely via string concatenation or equivalent logic, without:

  • Canonicalizing the path to remove . and .. segments
  • Enforcing that the resolved path stays within a predefined static root
  • Rejecting absolute paths or traversal patterns

As a result, an attacker can step out of the intended static assets directory and access arbitrary readable files on the server's filesystem.

Potential impact

  • Disclosure of sensitive system files (e.g., /etc/passwd on Unix-like systems)
  • Exposure of application configuration files containing secrets, credentials, or API keys
  • Leakage of source code, logs, and internal documentation that may facilitate further attacks
  • Insight into system structure, user accounts, and environment details that can aid privilege escalation and lateral movement
  • Potential indirect compromise of other services through stolen secrets or configuration data

General mitigation guidance

Effective mitigation centers on strictly constraining filesystem access for user-supplied paths and minimizing what the web process can read.

Common defensive patterns include:

  • Path normalization and validation: Canonicalize the requested path, remove . and .. segments, and verify that the final resolved path is still under a predefined static root directory before serving any file.
  • Use of safe file-serving abstractions: Prefer framework-provided static file handlers that handle path traversal defenses by default, rather than manually constructing filesystem paths.
  • Allowlist-based serving: Limit file access to an explicit list of known asset directories or filenames instead of interpreting arbitrary paths from user input.
  • Principle of least privilege: Run the application under an account with minimal filesystem permissions, restricting read access only to directories required for operation.
  • Segregation of sensitive assets: Keep secrets, configuration files, and sensitive data outside directories that are exposed or adjacent to web-served paths.

How teams detect issues like this

Organizations can detect and monitor for this class of issue using a combination of code-level and operational approaches:

  • Static analysis patterns: Scan for custom static file-serving code that:
  • Concatenates request parameters or URL path segments directly into filesystem paths
  • Uses API calls like open, fs.readFile, or equivalent with user-controlled input

Flag these for manual review to ensure proper path normalization and root enforcement.

  • Code review signals:
  • Hand-rolled directory traversal checks (e.g., simple substring checks for ../) instead of robust canonicalization
  • Lack of checks that verify a resolved path remains within an expected base directory
  • Bypassing framework-provided static file middleware in favor of ad hoc implementations
  • Runtime and log analysis:
  • Monitor access logs for patterns containing ../, %2e%2e/, or other encoded traversal attempts targeting static endpoints
  • Use web application firewalls (WAFs) or reverse proxies with rules that detect and optionally block directory traversal patterns
  • Security testing: Incorporate automated DAST scans and targeted security tests for directory traversal against all static and download endpoints as part of CI/CD pipelines.

Sources

SourceLink
github.comgithub.com/OpenCTI-Platform/opencti
exploit-db.comexploit-db.com/exploits/48595
opencti.ioopencti.io/
vulncheck.comvulncheck.com/advisories/opencti-directory-traversal

Frequently asked

questions

Yes. As long as the OpenCTI HTTP(S) interface is reachable, an attacker can exploit this issue remotely by sending crafted GET requests to the /static/css endpoint, without any authentication.

No. The vulnerability is exploitable by unauthenticated users. The only requirement is network access to the vulnerable OpenCTI instance.

The safest pattern is to ensure that any file-serving logic:

  • Canonicalizes and normalizes the incoming path
  • Enforces that resolved paths cannot escape a predefined static root
  • Uses framework or library mechanisms for static file serving that provide built-in protection against path traversal.

To prevent similar bugs:

  • Avoid constructing filesystem paths directly from untrusted input; when necessary, always resolve paths against a fixed base directory and validate them post-resolution.
  • Rely on well-reviewed framework utilities for serving static content instead of custom implementations.
  • Incorporate static analysis, secure code review checklists, and regular security testing focused on file access and static resource endpoints into the development lifecycle.
Find out what's already
exploitable in your codebase.