/

CVE-2026-24897

Severity:

CRITICAL RISK

(10.0)

Unrestricted File Upload / Path Traversal to Remote Code

CVE-2026-24897

Analyzed

Vulnerability type

Category:

Unrestricted File Upload / Path Traversal to Remote Code Execution

CWE:

CWE-22, CWE-94, CWE-434

Impact:

Remote Code Execution by authenticated low-privileged users

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

Erugo up to and including version 0.2.14 contains a flaw in how it validates user-supplied file paths when creating shares, allowing authenticated low-privileged users to upload arbitrary files to attacker-controlled locations.

By targeting writable paths inside the public web root, an attacker can upload and execute server-side code, resulting in full remote code execution and compromise of the Erugo instance.

Affected context

This vulnerability occurs in Erugo's file-sharing functionality where users can create shares and upload files to the server.

It manifests when the application:

  • Accepts user-controlled paths or locations for uploaded content,
  • Performs insufficient canonicalization or validation of those paths,
  • Exposes uploaded files directly through the public web root (or another executable context),
  • Executes or interprets certain file types (e.g., scripts) based on their location or extension.

The issue is most severe where the web server is configured to execute scripts or dynamic content from directories that users can target via crafted share paths.

Exploit preconditions

  • Attack surface: HTTP(S) interface of the Erugo instance (file upload / share creation endpoint).
  • Required access: Valid, low-privileged account with permission to create shares and upload files.
  • Control granted to attacker: Ability to specify or influence the destination path for uploaded files.
  • Trigger point: Creating a share with a crafted path that resolves into a writable directory under the public web root, followed by uploading a file containing executable code.
  • Why exploitation is possible:
  • User-supplied paths are not safely normalized or restricted to an approved directory scope.
  • The upload mechanism does not enforce strong constraints on target directories or executable file types.
  • The web server is configured to serve and potentially execute files from locations reachable via those attacker-controlled paths.

Why this happens

The root cause combines multiple insecure patterns:

  • Path Traversal (CWE-22): The application fails to properly normalize, canonicalize, and constrain user-supplied paths, allowing uploads to be directed outside of intended storage directories and into sensitive or executable locations (such as the web root).
  • Unrestricted File Upload (CWE-434): The upload functionality allows arbitrary file types and does not adequately enforce extension whitelisting, content-type validation, or separation of uploaded files from executable contexts.
  • Code Injection (CWE-94): When an attacker can place crafted files into a location that the server interprets as executable code, they effectively inject code into the server's execution environment.

Abstractly, this is a design flaw where path authority and code deployment authority are delegated to untrusted users: the application trusts both the path and the uploaded content without ensuring they remain in a non-executable, isolated storage area.

Potential impact

  • Remote execution of arbitrary code with the privileges of the Erugo web application or web server process.
  • Full compromise of the Erugo instance, including modification or exfiltration of stored files and configuration.
  • Pivoting to other systems via stolen credentials, data, or local network access.
  • Installation of web shells, backdoors, or malware for persistent access.
  • Tampering with shared content, leading to data corruption or further supply-chain style attacks (e.g., serving malicious files to users).

General mitigation guidance

Effective mitigation focuses on constraining where uploads can go and ensuring uploaded files are never treated as executable code:

  • Path handling and confinement:
  • Normalize and canonicalize all user-supplied paths before use, rejecting any paths that resolve outside a dedicated upload directory.
  • Use server-side path construction (e.g., join controlled base directories with sanitized identifiers) instead of trusting client-provided directories.
  • Enforce a fixed, non-configurable upload root; users should not be able to choose arbitrary filesystem locations.
  • Upload isolation and type controls:
  • Store uploaded files outside any web-executable directory, and serve them via controlled handlers instead of direct filesystem mapping.
  • Apply strict extension allowlists and verify the effective content type when possible.
  • Avoid executing or interpreting uploaded content; treat all uploads as opaque data.
  • Privilege and hardening:
  • Run the Erugo and web server processes with least privilege and limited filesystem write access, especially outside designated upload areas.
  • Restrict execute permissions on upload directories at the OS and server configuration levels.
  • Secure-by-default design:
  • Design sharing features so that users select logical targets (e.g., "folders" in the application) rather than raw filesystem paths.
  • Prefer immutable or system-generated identifiers for storage locations rather than user-chosen paths.

How teams detect issues like this

Organizations can apply multiple layers of detection and review:

  • Static analysis and code review:
  • Flag any use of user input in path construction (e.g., concatenating request parameters into filesystem paths) without canonicalization and directory traversal checks.
  • Identify upload handlers that write directly under the web root or other executable directories.
  • Look for missing checks on file extensions, MIME types, and upload directory boundaries.
  • Configuration and policy checks:
  • Audit web server configurations for directories that are both writable and executable/servable.
  • Enforce policies that disallow application-level control over server-side executable paths.
  • Runtime and operational monitoring:
  • Monitor for uploads of script-like files into web-exposed directories (e.g., via file integrity monitoring).
  • Log and alert on unusual share paths or patterns that suggest traversal or use of system directories.
  • Use web application firewalls (WAFs) to detect suspicious upload requests and path patterns, while recognizing that WAFs are a compensating, not primary, control.
  • Automated tooling:
  • Integrate automated code scanners to detect CWE-22 and CWE-434 patterns in CI/CD pipelines.
  • Periodically run dynamic security tests focused on upload endpoints and file-serving paths.

Sources

SourceLink
github.comgithub.com/ErugoOSS/Erugo/commit/256bc63831a0b5e9a94cb024a0724e0cd5fa5e38
github.comgithub.com/ErugoOSS/Erugo/releases/tag/v0.2.15
github.comgithub.com/ErugoOSS/Erugo/security/advisories/GHSA-336w-hgpq-6369

Frequently asked

questions

Yes. Any attacker who can reach the Erugo web interface and obtain a low-privileged account with share-creation and upload rights can exploit this issue remotely, provided the instance is accessible over the network.

No. The vulnerability is exploitable by authenticated low-privileged users. They only need the ability to create shares and upload files; administrator or system-level permissions are not required for initial compromise.

The most robust fix is to strictly confine all uploads to non-executable storage locations managed entirely by the server (not by user-supplied paths), enforce strong validation of file types, and ensure that no uploaded file can ever be executed or interpreted as code by the web server or application runtime.

Treat all path and file-related input as untrusted, use canonicalization and directory whitelisting for any filesystem access, design upload subsystems so that users never control real filesystem paths, and rigorously separate data storage from executable code locations. Regular secure code reviews and automated scanning for path traversal and unrestricted upload patterns further reduce the risk of reintroducing this class of vulnerability.

Find out what's already
exploitable in your codebase.