Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-97359 Overview
CVE-2026-97359 is a template injection vulnerability in HFS2 (HTTP File Server 2) version 2.4.0 and earlier. The flaw resides in the multipart upload handler, which fails to sanitize filenames before passing them to the template engine. Unauthenticated attackers can craft a filename that contains a closing template quoting sequence followed by an exec macro. The payload bypasses the dispatcher's authorization check and executes arbitrary operating system commands on the host running HFS2. The vulnerability is classified under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine.
Critical Impact
Unauthenticated remote attackers can achieve full remote code execution on HFS2 servers by uploading a file with a specially crafted filename.
Affected Products
- HFS2 version 2.4.0
- HFS2 versions prior to 2.4.0
- Any deployment of HFS2 exposing the multipart upload endpoint
Discovery Timeline
- 2026-09-24 - CVE-2026-97359 published to the National Vulnerability Database
- 2026-09-29 - Last updated in NVD database
Technical Details for CVE-2026-97359
Vulnerability Analysis
HFS2 renders user-supplied strings through an internal template engine that supports macro expansion, including an exec macro capable of invoking system commands. The multipart upload handler accepts filenames from clients and incorporates them into template contexts without neutralizing template control characters. When a filename contains a closing quoting sequence followed by a macro expression, the parser exits the string literal and evaluates the attacker-supplied macro. Because the upload path reaches the template render step before the dispatcher evaluates authorization, the vulnerability is reachable without credentials. See the GitHub Advisory on HFS2 and VulnCheck HFS2 RCE Advisory for technical details.
Root Cause
The root cause is improper neutralization of template syntax in user-controlled input [CWE-1336]. The multipart upload handler trusts the filename field from the HTTP request and forwards it to the template renderer. The renderer treats the string as a template fragment rather than literal data, enabling macro evaluation during filename processing.
Attack Vector
An attacker sends a standard HTTP multipart POST to the HFS2 upload endpoint with a filename that embeds a template-closing sequence and an exec macro invocation. No authentication or user interaction is required. The server renders the filename through the template engine, executes the macro, and returns the server response. The attacker gains command execution under the privileges of the HFS2 process.
The vulnerability is described in prose only. No verified proof-of-concept code is reproduced here. Technical specifics, including the exact macro syntax and endpoint path, are documented in the referenced advisories.
Stop Remote Code Execution Before It Runs
Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.
Stop Exploit AttemptsDetection Methods for CVE-2026-97359
Indicators of Compromise
- HTTP multipart upload requests whose Content-Disposition filename parameter contains template delimiters, quote characters, or the substring exec
- Child processes spawned by the HFS2 server binary that execute shell interpreters such as cmd.exe, powershell.exe, or /bin/sh
- New or modified files in HFS2 upload directories accompanied by outbound network connections from the HFS2 process
- Unexpected scheduled tasks, services, or persistence artifacts created by the HFS2 process account
Detection Strategies
- Inspect HTTP request logs for anomalous characters in multipart filename fields, including backticks, braces, and quote sequences
- Alert on process lineage where HFS2 is the parent of command interpreters or scripting engines
- Correlate upload events with immediate outbound network activity from the server to detect staged payloads
- Deploy behavioral endpoint detection to flag command execution originating from file server processes
Monitoring Recommendations
- Capture full HTTP request headers and bodies for the HFS2 upload endpoint and retain for post-incident analysis
- Monitor filesystem writes to directories writable by the HFS2 service account
- Baseline normal HFS2 process behavior and alert on deviations such as new child processes or socket activity
How to Mitigate CVE-2026-97359
Immediate Actions Required
- Remove HFS2 instances from untrusted networks until a vendor patch is available and applied
- Restrict access to the HFS2 upload endpoint using network ACLs, reverse-proxy authentication, or firewall rules
- Audit HFS2 hosts for signs of exploitation, focusing on child processes and new files created by the HFS2 service account
- Rotate credentials and secrets accessible from any HFS2 host that was internet-exposed
Patch Information
No fixed version is identified in the enriched CVE data at the time of publication. Monitor the GitHub Advisory on HFS2 and the VulnCheck HFS2 RCE Advisory for release information and apply the vendor update as soon as it is available.
Workarounds
- Disable the multipart upload functionality in HFS2 configuration where feasible
- Place HFS2 behind a reverse proxy that enforces authentication and strips or rejects filenames containing template metacharacters
- Run HFS2 under a low-privilege service account with no shell access and no write permissions outside required directories
- Apply egress filtering to prevent compromised HFS2 hosts from reaching attacker infrastructure
# Example reverse-proxy filter (nginx) to drop uploads with suspicious filenames
location /upload {
if ($request_body ~* "filename=\"[^\"]*(\{|\}|exec|`)") {
return 400;
}
proxy_pass http://hfs2_backend;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

