/

CVE-2020-36939

Severity:

HIGH RISK

(7.5)

Directory Traversal in Cassandra Web Arbitrary File Reader

CVE-2020-36939

Deferred

Vulnerability type

Category:

Directory Traversal

CWE:

CWE-22

Impact:

Sensitive Information Disclosure and Potential Credential Compromise

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

Cassandra Web 0.5.0 exposes a directory traversal flaw that lets unauthenticated users read arbitrary files from the underlying server by manipulating path parameters.

When exploited, this can disclose sensitive system files such as /etc/passwd and configuration files containing Apache Cassandra database credentials.

Affected context

This vulnerability appears in deployments running Cassandra Web 0.5.0 where file paths are accepted from HTTP requests and are used directly to read files from disk.

It is particularly relevant when the application is deployed on servers that store sensitive configuration files, OS-level files, or Cassandra credential files in readable locations.

The issue is exacerbated when HTTP request hardening and middleware protections (such as Rack::Protection) are disabled or misconfigured.

Exploit preconditions

  • Attack surface: Public or internal HTTP endpoints exposed by Cassandra Web that accept path or filename parameters.
  • Required access: No authentication required; any network-accessible user can send crafted requests.
  • Trigger point: User-controlled path parameters are used by the server to access files without proper normalization or restriction to an allowed directory.
  • Why exploitation is possible: The application does not sufficiently validate or sanitize path input, allowing sequences like ../ to escape the intended directory scope, and a disabled protection module removes an additional defense layer.

Why this happens

The underlying bug is a classic directory traversal issue, mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

Cassandra Web exposes a file access mechanism that relies on user-supplied path segments but fails to normalize and constrain those paths to a known safe base directory.

As a result, input containing traversal tokens (e.g., moving up directories) is treated as valid and passed to file access APIs, enabling direct access to files outside the intended web-accessible or data directories.

Potential impact

  • Disclosure of OS-level files such as /etc/passwd that may aid further attacks.
  • Exposure of Apache Cassandra configuration files and database credentials.
  • Leakage of application configuration, logs, and internal infrastructure details.
  • Facilitation of lateral movement or privilege escalation by providing reconnaissance data and secrets.

General mitigation guidance

Effective mitigation typically focuses on strict path handling and minimizing what the web layer can read:

  • Enforce a fixed, canonical base directory for any file access and reject paths that resolve outside this directory after normalization.
  • Strip or reject path traversal sequences such as ../ and other encoded variants before using paths with filesystem APIs.
  • Use allowlists of file names or identifiers instead of accepting free-form paths from clients.
  • Run the Cassandra Web process under a dedicated, least-privileged account with no read access to sensitive system or credential files.
  • Enable and correctly configure web framework protection middleware and HTTP hardening layers to add defense-in-depth.

How teams detect issues like this

Detection can leverage both code-focused and operational approaches:

  • Static analysis: Look for file access calls (File.read, open, etc.) that use request parameters or query strings without path normalization or directory checks.
  • Code review: Flag any endpoints that expose direct file browsing or downloading, confirming that they enforce a restricted root directory and canonicalization.
  • Configuration review: Verify that protective middleware (such as Rack::Protection) is enabled and that security headers and routing rules are in place.
  • Runtime monitoring: Monitor HTTP logs for suspicious patterns like repeated ../ sequences, encoded traversal payloads, or attempts to access known sensitive paths.

Sources

SourceLink
github.comgithub.com/avalanche123/cassandra-web
rubygems.orgrubygems.org/gems/cassandra-web/versions/0.5.0
exploit-db.comexploit-db.com/exploits/49362
vulncheck.comvulncheck.com/advisories/cassandra-web-remote-file-read

Frequently asked

questions

Yes. If Cassandra Web is accessible over the network, an unauthenticated remote user can exploit the directory traversal by sending crafted HTTP requests.

No. The described issue affects unauthenticated endpoints, so attackers do not need valid credentials to attempt exploitation.

Constrain all file access operations to a fixed, canonical base directory, normalize incoming paths, and reject any request that resolves outside that directory. Prefer mapping user input to predefined identifiers instead of accepting raw paths.

Adopt secure-by-default file handling patterns, apply strict input validation and canonicalization for any path-related parameters, enable framework-level protection modules, and include path traversal checks in code review and automated security testing pipelines.

Find out what's already
exploitable in your codebase.