Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 0.1%top 81%

CVE-2026-40876: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in patrickhener goshs

0
High
VulnerabilityCVE-2026-40876cvecve-2026-40876cwe-22
Published: Tue Apr 21 2026 (04/21/2026, 19:34:19 UTC)
Source: CVE Database V5
Vendor/Project: patrickhener
Product: goshs

Description

CVE-2026-40876 is a path traversal vulnerability in patrickhener goshs, a SimpleHTTPServer written in Go. Versions prior to 2. 0. 0-beta. 6 improperly validate SFTP paths using a prefix-based check, allowing authenticated SFTP users to escape the intended root jail. This enables reading and writing files outside the configured SFTP root directory, potentially exposing or modifying unrelated server files. The issue arises because the path validation does not correctly enforce directory boundaries, allowing sibling directories with similar prefixes to bypass restrictions. This vulnerability has a high severity score of 8. 7 and is fixed in version 2. 0.

CVSS v4.0

Score 8.7high

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 04/29/2026, 11:42:06 UTC

Technical Analysis

The goshs SFTP subsystem routes file operations through handlers relying on sanitizePath(), which uses a raw string-prefix comparison for path validation. This flawed approach allows paths like /tmp/goshsroot_evil/secret.txt to pass validation when the root is /tmp/goshsroot, enabling an authenticated user to escape the SFTP root jail. The vulnerability affects all goshs versions before 2.0.0-beta.6 and is categorized as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory).

Potential Impact

An authenticated SFTP user can read and write files outside the configured SFTP root directory, breaking the intended jail boundary. This can lead to unauthorized exposure or modification of unrelated server files, potentially compromising server integrity and confidentiality.

Mitigation Recommendations

This vulnerability is fixed in goshs version 2.0.0-beta.6. Users should upgrade to this version or later to remediate the issue. No official patch or temporary fix is indicated beyond upgrading. Patch status is not explicitly confirmed in vendor advisories, so users should verify with the official goshs project for the latest remediation guidance.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-04-15T15:57:41.718Z
Cvss Version
4.0
State
PUBLISHED
Remediation Level
null

Threat ID: 69e7d78519fe3cd2cdf5b319

Added to database: 4/21/2026, 8:01:09 PM

Last enriched: 4/29/2026, 11:42:06 AM

Last updated: 6/5/2026, 4:03:26 PM

Views: 46

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses