/

CVE-2026-34745

Severity:

CRITICAL RISK

(9.1)

Path Traversal File Write in Fireshare Public Chunked

CVE-2026-34745

Analyzed

Vulnerability type

Category:

Path Traversal / Arbitrary File Write

CWE:

CWE-22

Impact:

Arbitrary File Write Leading to Potential Remote Code Execution or Data Compromise

Severity:

CRITICAL RISK

(9.1)

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

Fireshare's unauthenticated /api/uploadChunked/public endpoint contains a path traversal vulnerability that allows attackers to control where uploaded files are written on the server's filesystem.

By abusing the checkSum parameter, an unauthenticated attacker can write arbitrary files to any writable path, enabling scenarios such as web shell placement, configuration overwrites, or data tampering.

Affected context

This vulnerability affects Fireshare instances that:

  • Expose the /api/uploadChunked/public endpoint to unauthenticated users
  • Accept user-supplied upload metadata, including a checkSum parameter
  • Run with filesystem locations that are writable by the Fireshare process and accessible by other components (e.g., web server, application runtime, or scheduled jobs)

The issue exists in the server-side upload handling logic in app/server/fireshare/api.py, where the public upload path is not subject to the same path validation and normalization controls as the authenticated upload path.

Exploit preconditions

  • Attack surface: Network-accessible HTTP(S) interface exposing /api/uploadChunked/public.
  • Required access: No authentication required; attacker only needs the ability to send crafted upload requests to the application.
  • Trigger point: Submission of chunked upload requests where the checkSum or related parameter influences the destination filename or path.
  • Why exploitation is possible: The server-side path construction logic incorporates user-controlled data (e.g., checkSum) into filesystem paths without consistently enforcing canonicalization, whitelisting, or confinement to a dedicated upload directory. This allows directory traversal and arbitrary file placement under any path writable by the Fireshare process.

Why this happens

The root cause aligns with CWE-22: Path Traversal, where user input is used to construct filesystem paths without robust validation.

In Fireshare's upload handler, the checkSum parameter or associated metadata is used to derive the output file path for chunked uploads.

Because this parameter is not subjected to strict normalization, allowed-character constraints, or confinement to a fixed base directory for the public endpoint, an attacker can inject traversal sequences or crafted values that escape the intended upload directory and write files elsewhere.

Conceptually, this reflects an insecure pattern of:

  • Trusting client-controlled identifiers for both naming and locating stored files
  • Applying security checks to one code path (authenticated endpoint) but not consistently mirroring them in analogous unauthenticated code paths.

Potential impact

  • Arbitrary file creation or overwriting in any directory writable by the application process
  • Possible remote code execution if the attacker can place executable code in a location interpreted by the runtime or web server (e.g., templates, plug-ins, or scripts)
  • Overwriting application or configuration files, potentially modifying behavior, disabling security controls, or causing denial of service
  • Planting backdoors or malicious artifacts for persistence or lateral movement
  • Tampering with logs, uploaded content, or other data files to manipulate audit trails or user-visible resources

General mitigation guidance

Mitigation generally focuses on strict path handling and constraining file storage locations:

  • Treat all user-supplied path components (including IDs like checksums) as untrusted and never use them directly as filesystem paths.
  • Constrain uploads to a single, dedicated directory that is outside of any executable or web-accessible root, and ensure all paths are resolved relative to this base.
  • Normalize and canonicalize any derived path, then enforce checks that reject inputs that attempt to escape the upload directory (e.g., by comparing canonical paths or using OS APIs to confine access).
  • Use server-generated, opaque identifiers for file storage names rather than client-controlled values, storing any logical mapping in a database.
  • Limit filesystem permissions so the application process can only write to a minimal set of directories, avoiding write access to application code, configuration, or system directories.
  • Align security checks across similar endpoints so that protections applied to authenticated upload flows are also consistently applied to public or anonymous flows.

How teams detect issues like this

Detection can combine code-focused and operational approaches:

  • Static analysis: Define rules to flag any filesystem write operations that incorporate request parameters, especially in upload handlers. Look for uses of open, file move operations, or storage APIs where user input influences path components.
  • Code review signals:
  • Endpoints that accept file uploads without strong authentication or authorization.
  • Direct concatenation of user input into paths without normalization and base-directory checks.
  • Separate code paths (authenticated vs public) that appear to duplicate logic but do not share common validation functions.
  • Runtime monitoring:
  • Log file write operations, including destination paths and associated endpoints, and alert on writes outside designated upload directories.
  • Configure intrusion detection or host-based monitoring to alert on new or modified files in sensitive locations (e.g., application directories, configuration paths).
  • Policy enforcement:
  • Use CI/CD policies that require path-confinement wrappers or storage abstractions for any new file write capability.
  • Integrate SAST/IAST tools into pipelines to automatically identify path traversal patterns in upload handlers and file-management code.

Sources

SourceLink
github.comgithub.com/ShaneIsrael/fireshare/commit/b76915607924756e6fa1a5f6c8823c38d611fb24
github.comgithub.com/ShaneIsrael/fireshare/pull/520
github.comgithub.com/ShaneIsrael/fireshare/releases/tag/v1.5.3
github.comgithub.com/ShaneIsrael/fireshare/security/advisories/GHSA-fvvp-rj8g-c7gc

Frequently asked

questions

Any unauthenticated user who can reach the /api/uploadChunked/public endpoint over the network can attempt exploitation. No valid user account or prior compromise is required, though the attacker is constrained by the filesystem permissions of the Fireshare process.

No local access is required. Exploitation occurs entirely over HTTP(S) by sending crafted upload requests. The server-side code performs the file writes based on untrusted parameters in those requests.

Centralize and harden upload handling by confining all file writes to a dedicated directory, using server-generated filenames, and enforcing strict canonicalization and directory-escape checks. Ensure that this hardened path is reused across both authenticated and public endpoints.

Establish a secure file-storage abstraction that developers must use for any file writes, with built-in path confinement and validation. Combine this with security-focused code review practices, automated scanning for path construction using user input, and clear guidelines prohibiting direct use of request parameters in filesystem paths.

Find out what's already
exploitable in your codebase.