Skip to main content

EUVDEUVD-2026-20495

| CVE-2026-39408 MEDIUM
Path Traversal (CWE-22)
2026-04-08 https://github.com/honojs/hono GHSA-xf4j-xp2r-rqqx
5.9
CVSS 4.0 · GitHub Advisory
Share

Severity by source

GitHub Advisory PRIMARY
5.9 MEDIUM
CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Primary rating from GitHub Advisory · only source for this CVE.

CVSS VectorGitHub Advisory

CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Attack Vector
Local
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
X

Lifecycle Timeline

4
EUVD ID Assigned
Apr 08, 2026 - 00:30 euvd
EUVD-2026-20495
Analysis Generated
Apr 08, 2026 - 00:30 vuln.today
Patch released
Apr 08, 2026 - 00:30 nvd
Patch available
CVE Published
Apr 08, 2026 - 00:16 nvd
MEDIUM 5.9

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 1 npm packages depend on hono (1 direct, 0 indirect)

Ecosystem-wide dependent count for version 4.0.0.

DescriptionGitHub Advisory

Summary

A path traversal issue in toSSG() allows files to be written outside the configured output directory during static site generation. When using dynamic route parameters via ssgParams, specially crafted values can cause generated file paths to escape the intended output directory.

Details

The static site generation process creates output files based on route paths derived from application routes and parameters. When ssgParams is used to provide values for dynamic routes, those values are used to construct output file paths. If these values contain traversal sequences (e.g. ..), the resulting output path may resolve outside the configured output directory. As a result, files may be written to unintended locations instead of being confined within the specified output directory.

For example:

ts
import { Hono } from 'hono'
import { toSSG, ssgParams } from 'hono/ssg'

const app = new Hono()

app.get('/:id', ssgParams([{ id: '../pwned' }]), (c) => {
  return c.text('pwned')
})

toSSG(app, fs, { dir: './static' })

In this case, the generated output path may resolve outside ./static, resulting in a file being written outside the intended output directory.

Impact

An attacker who can influence values passed to ssgParams during the build process may be able to write files outside the intended output directory.

Depending on the build and deployment environment, this may:

  • overwrite unintended files
  • affect generated artifacts
  • impact deployment outputs or downstream tooling

This issue is limited to build-time static site generation and does not affect request-time routing.

AnalysisAI

Path traversal in Hono's toSSG() function allows attackers to write files outside the configured output directory during static site generation by injecting traversal sequences into ssgParams dynamic route values. The vulnerability is limited to build-time operations and does not affect runtime request handling. A vendor-released patch is available in Hono v4.12.12.

Technical ContextAI

Hono is a lightweight web framework for JavaScript/TypeScript that includes static site generation (SSG) capabilities via the toSSG() function. The vulnerability exists in how ssgParams processes dynamic route parameters to construct output file paths. When user-controlled or attacker-influenced values are passed to ssgParams for dynamic routes (e.g., /:id), the framework fails to sanitize path traversal sequences like ../ before constructing the final output path. This violates CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) by allowing relative path manipulation to escape the intended output directory boundary. The affected product is the npm package 'hono' (pkg:npm/hono), which is widely used for building web applications and static sites in the Node.js/JavaScript ecosystem.

RemediationAI

Vendor-released patch: upgrade Hono to v4.12.12 or later, which resolves the path traversal issue in toSSG(). Update package.json to reference hono@^4.12.12 and run npm install (or equivalent for yarn/pnpm). The upstream fix is available in commit b470278920fffcfd6d76002755d6db53db827679 (https://github.com/honojs/hono/commit/b470278920fffcfd6d76002755d6db53db827679). Users unable to upgrade immediately should avoid passing untrusted or user-controlled values to ssgParams and validate/sanitize any dynamic parameters before SSG execution. Review build process and CI/CD configuration to ensure ssgParams values originate from trusted sources only.

Share

EUVD-2026-20495 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy