Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') Affecting hono package, versions <4.2.7


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.04% (13th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-HONO-6672874
  • published24 Apr 2024
  • disclosed23 Apr 2024
  • credity0d3n

Introduced: 23 Apr 2024

CVE-2024-32869  (opens in a new tab)
CWE-22  (opens in a new tab)

How to fix?

Upgrade hono to version 4.2.7 or higher.

Overview

hono is an Ultrafast web framework for the Edges

Affected versions of this package are vulnerable to Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') such that when using serveStatic with deno, it is possible to traverse the directory where main.ts is located, leading to the retrieval of unexpected files.

PoC

import { Hono } from 'https://deno.land/x/hono@v4.2.6/mod.ts'
import { serveStatic } from 'https://deno.land/x/hono@v4.2.6/middleware.ts'

const app = new Hono()
app.use('/static/*', serveStatic({ root: './' }))

Deno.serve(app.fetch)

References

CVSS Scores

version 3.1