CVE-2026-40188
7.7patrickhener · goshs
The goshs SimpleHTTPServer fails to sanitize the destination path during SFTP rename operations, allowing unauthorized file writes outside the intended root directory.
Executive summary
An authenticated path traversal vulnerability in the goshs SimpleHTTPServer allows remote attackers to write files outside the root directory, posing a significant risk to file system integrity.
Vulnerability
This is a path traversal flaw (CWE-1314) occurring in the SFTP rename command, where the application fails to validate the destination path. The vulnerability requires the attacker to have authenticated access to the SFTP service.
Business impact
The ability to write arbitrary files to a host filesystem can lead to full system compromise if an attacker overwrites critical configuration files, scripts, or binaries. With a CVSS score of 7.7, this vulnerability is classified as High severity, as it facilitates unauthorized file manipulation and potential escalation of privileges within the affected environment.
Remediation
Immediate Action: Update the goshs software to version 2.0.0-beta.4 or later to apply the necessary path validation logic.
Proactive Monitoring: Review SFTP access logs for suspicious rename commands or attempts to navigate directory structures using parent directory references.
Compensating Controls: Restrict SFTP access to trusted IP addresses via network-level firewalls and ensure the application process runs with the least privilege necessary to limit the impact of potential file system writes.
Exploitation status
Public Exploit Available: No (the available data does not confirm a published, weaponized exploit).
Analyst recommendation
Given the potential for unauthorized file system modification, organizations utilizing the goshs server should prioritize patching to version 2.0.0-beta.4 immediately. If an immediate update is not feasible, restrict service access to trusted users and monitor logs for anomalous directory traversal patterns to mitigate the risk of exploitation.