/

CVE-2026-27897

Severity:

CRITICAL RISK

(10.0)

Path Traversal File Write in Vociferous export_file API

CVE-2026-27897

Analyzed

Vulnerability type

Category:

Path Traversal / Arbitrary File Write

CWE:

CWE-22, CWE-306

Impact:

Arbitrary File Write and Local System Compromise

Severity:

CRITICAL RISK

(10.0)

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

Vociferous's unauthenticated export_file API endpoint accepts a filename from a JSON payload and writes user-supplied content to disk without validating or constraining the path.

When combined with overly permissive CORS, an external attacker can bypass the UI and use directory traversal sequences to write arbitrary files anywhere the Vociferous process has permissions.

Affected context

This vulnerability affects deployments of Vociferous prior to version 4.4.2 running the API server with the export_file route enabled.

The issue is present when:

  • The application is exposed to a browser context (e.g., Electron, local web UI, browser extension, or similar),
  • CORS is configured as allow_origins=["*"] or otherwise permits requests from arbitrary or relaxed origins (including localhost in cross-origin setups),
  • The export_file route in src/api/system.py is reachable on a network-accessible interface,
  • The process has write permissions to user or system directories.

In such environments, the lack of filename validation allows attacker-controlled paths to reach underlying filesystem calls.

Exploit preconditions

  • Attack surface: HTTP API endpoint export_file exposed by the Vociferous backend.
  • Required access: No authentication is required; attacker only needs the ability to send cross-origin or direct HTTP requests to the running instance.
  • Trigger point: Submission of a crafted JSON payload containing:
  • filename: a string with directory traversal patterns (e.g., ../ segments or absolute paths),
  • content: arbitrary data to be written.
  • Why exploitation is possible:
  • The API trusts the filename provided by the client and passes it directly into filesystem operations.
  • No normalization, sanitization, or restriction to an allowed directory is performed on the filename.
  • CORS configuration is overly permissive, enabling web pages under attacker control to call the API from a user's browser without UI interaction.
  • Missing or ineffective authentication and authorization (related to CWE-306) allow untrusted parties to invoke the endpoint.

Why this happens

The core issue is a path traversal flaw (CWE-22) combined with missing access control on a file-writing endpoint.

The export_file route treats the filename value from the JSON body as a trusted filesystem path and forwards it to backend file I/O.

Because the path is not normalized, canonicalized, or constrained to a safe base directory, attackers can include directory traversal sequences (such as ../) or absolute paths to escape the intended export location and write to arbitrary paths.

This insecure pattern is exacerbated by an unauthenticated API (CWE-306) and overly permissive CORS policy, which together extend the attack surface from local, trusted callers to any external origin capable of issuing HTTP requests.

Abstractly, this is a case of trusting client-controlled path and authorization assumptions instead of enforcing them on the server side.

Potential impact

  • Creation or overwriting of arbitrary files within any directory writable by the Vociferous process (e.g., user home, configuration directories, temporary directories).
  • Tampering with application or user configuration files, potentially leading to arbitrary code execution on next application or system startup.
  • Planting malicious scripts, shortcuts, or executables in auto-start or commonly executed paths.
  • Overwriting security-relevant files (logs, policy files, or model/config data) to hide activity or weaken defenses.
  • Corruption or deletion (via overwrite) of user data and project files, leading to data loss or denial of service.
  • Pivoting to broader system compromise if combined with other local vulnerabilities or insecure tooling that loads files from attacker-controlled locations.

General mitigation guidance

Risk reduction should focus on constraining file paths, enforcing authentication, and tightening origin trust:

  • Constrain allowed paths:
  • Resolve and canonicalize any client-provided filename against a fixed base directory (e.g., a dedicated "exports" folder).
  • Reject paths that resolve outside the intended directory after normalization.
  • Use server-generated filenames where possible, treating any client input as a label rather than a path.
  • Validate and sanitize inputs:
  • Explicitly validate filename strings against an allowlist of characters, extensions, and path patterns.
  • Reject absolute paths and disallow any .., drive specifiers, or other traversal constructs.
  • Enforce authentication and authorization:
  • Require users to be authenticated before invoking file-writing endpoints.
  • Apply per-user scoping so one user cannot write into another user's files.
  • Only expose such endpoints on trusted interfaces where access can be controlled.
  • Harden CORS and UI boundaries:
  • Restrict CORS to known, trusted origins and avoid wildcard (*) or overly broad localhost allowances.
  • Treat backend APIs as security-sensitive, not merely UI helpers, and design them as if directly exposed to the network.
  • Principle of least privilege:
  • Run the application under a user account with limited filesystem rights.
  • Avoid granting write permissions to sensitive system locations that are not required for normal operation.

How teams detect issues like this

Detection efforts can leverage both code-centric and behavior-centric approaches:

  • Static analysis and code review:
  • Search for filesystem write operations (open(..., 'w'), writeFile, etc.) that use path components derived from HTTP request fields (e.g., JSON body filename).
  • Flag any use of user-controlled input concatenated or directly passed into filesystem APIs without normalization or base-directory enforcement.
  • Check for endpoints that modify the filesystem but do not enforce authentication or authorization (CWE-306).
  • Review CORS configuration for wildcards or broad origin allowances, especially on endpoints that perform state-changing operations.
  • Security testing and fuzzing:
  • Use dynamic tests to send filenames containing traversal sequences, absolute paths, or unusual encodings, and verify whether the application writes outside expected directories.
  • Simulate cross-origin requests through a browser to confirm whether SOP+CORS allow calls to sensitive endpoints.
  • Operational monitoring:
  • Monitor application logs for export or write operations targeting unexpected directories.
  • Track sudden appearance or modification of files in system or configuration paths that correlate with API activity.
  • Automated tooling:
  • Integrate static application security testing (SAST) tools configured to detect path traversal and unsafe file writes.
  • Use dependency and configuration analyzers to highlight permissive CORS and missing auth on sensitive routes.

Sources

SourceLink
github.comgithub.com/WanderingAstronomer/Vociferous/security/advisories/GHSA-7cpr-frgj-h85v

Frequently asked

questions

Yes. Because the export_file endpoint is unauthenticated and CORS is overly permissive, a remote attacker can exploit this from a browser or any client that can reach the Vociferous API, without needing local access or UI interaction.

The attacker must be able to send HTTP requests to the Vociferous backend. In typical setups where the backend listens on localhost or a user's machine, a malicious website can trigger cross-origin requests from the victim's browser if CORS allows it. No application login or credentials are required.

Constrain file writes to a specific, server-defined directory; normalize and validate all filenames; reject any paths that escape the allowed directory; and require authentication for file-writing operations. Additionally, tighten CORS to only allow trusted origins that are under the developer's control.

Treat all client-supplied paths as untrusted, enforce strict path normalization and allowlists, and design backend APIs as if they were directly exposed to hostile clients. Combine this with defense-in-depth controls—authentication, least-privilege filesystem access, and conservative CORS policies—to ensure that even if one layer fails, attackers cannot perform arbitrary file operations.

Find out what's already
exploitable in your codebase.