Skip to main content

@Mockoon/commons-server: Path traversal in templated `filePath` lets a request escape the served directory (prefix-only base check) (CVE-2026-59149)

0
Medium
Published: 09/11/2026 (09/11/2026, 22:04:32 UTC)
Source: GCVE Database
Product: @mockoon/commons-server

Description

A path traversal vulnerability in @mockoon/commons-server allows unauthenticated clients to read files outside the intended served directory. The vulnerability arises because the path validation uses a prefix string check that can be bypassed by crafted relative paths, enabling access to sibling directories. This affects versions prior to 9.7.0. A fix is available.

CVSS v3.1

Score 6.5medium

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N

Affected software

npmghsa
@mockoon/commons-server
Affected versions
<9.7.0
npmghsa
@mockoon/cli
Affected versions
<9.7.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/12/2026, 00:45:26 UTC

Technical Analysis

The vulnerability exists in the getSafeFilePath function of @mockoon/commons-server where the static base directory is checked using a string prefix match (resolvedPath.startsWith(staticBaseDir)) without ensuring a path separator boundary. This allows a crafted filePath containing '../' sequences to escape the intended directory and access files in sibling directories whose absolute paths start with the base directory string. The filePath is request-controlled via templating, affecting all FILE response types. The issue is confirmed in versions before 9.7.0. A proof-of-concept demonstrates reading sensitive files outside the served directory.

Potential Impact

An unauthenticated attacker can read arbitrary files on the server outside the intended served directory, potentially exposing sensitive information. The vulnerability does not allow modification or deletion of files, only read access. The CVSS score is 6.5 (medium severity) with network attack vector, low attack complexity, no privileges required, user interaction required, and high confidentiality impact.

Mitigation Recommendations

A patch is available for this vulnerability. Users should upgrade @mockoon/commons-server to version 9.7.0 or later where the path traversal issue is fixed by properly validating file paths with path separator boundaries. Until patched, avoid using request-controlled data in filePath templates or implement additional path validation to prevent directory traversal.

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

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-8wqc-v2q8-vff2
Osv Schema Version
1.4.0
Aliases
["CVE-2026-59149"]
Ecosystems
["npm"]
Database Specific Severity
MODERATE
Cvss Version
3.1

Threat ID: 6aa49ff455bf5e2cf5a863d8

Added to database: 09/12/2026, 00:42:28 UTC

Last enriched: 09/12/2026, 00:45:26 UTC

Last updated: 09/12/2026, 00:45:26 UTC

Views: 1

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