CVE-2026-39408
Received Received - Intake
Path Traversal in Hono toSSG() Allows Arbitrary File Write

Publication date: 2026-04-08

Last updated on: 2026-04-21

Assigner: GitHub, Inc.

Description
Hono is a Web application framework that provides support for any JavaScript runtime. Prior to 4.12.12, 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. This vulnerability is fixed in 4.12.12.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-04-08
Last Modified
2026-04-21
Generated
2026-05-07
AI Q&A
2026-04-08
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
hono hono From 4.0.0 (inc) to 4.12.11 (inc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

CVE-2026-39408 is a path traversal vulnerability in the toSSG() function of the hono JavaScript framework versions 4.0.0 through 4.12.11. This vulnerability occurs during static site generation (SSG) when dynamic route parameters (ssgParams) contain specially crafted values with path traversal sequences like '../'.

Because of this, the generated file paths can escape the intended output directory, allowing files to be written outside the configured directory. This means an attacker who controls the ssgParams values during build time can cause files to be written to arbitrary locations on the file system.

The vulnerability is fixed in version 4.12.12 by adding checks that ensure generated file paths remain within the output directory.


How can this vulnerability impact me? :

This vulnerability allows an attacker with local access during build time to write files outside the intended output directory. This can lead to overwriting unintended files, corrupting generated artifacts, or affecting deployment outputs and downstream tooling.

Since the issue only affects static site generation at build time, it does not impact runtime request routing or availability.

The impact is primarily on integrity, as unauthorized file writes can compromise the correctness and trustworthiness of generated files.


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability is a path traversal issue in the static site generation (SSG) process of the hono framework, specifically in the toSSG() function when using dynamic route parameters via ssgParams. Detection involves checking if any generated file paths escape the intended output directory during build time.

Since the vulnerability occurs during build time and involves crafted ssgParams values, detection can be done by reviewing build scripts or static site generation logs for unusual file writes outside the configured output directory.

There are no direct network detection commands because the attack vector is local and requires build-time access.

Suggested commands to detect potential exploitation or attempts include:

  • Using find to locate files created outside the expected output directory, for example: find /path/to/project -type f ! -path './static/*'
  • Checking build logs for errors or warnings related to path traversal or file writes outside the output directory.
  • Reviewing the source code or build scripts for usage of ssgParams with untrusted input or dynamic route parameters that may contain '../' sequences.

What immediate steps should I take to mitigate this vulnerability?

The primary mitigation is to upgrade the hono package to version 4.12.12 or later, where the vulnerability is fixed.

The fix includes a new utility function that ensures generated file paths remain strictly within the configured output directory, preventing path traversal.

Additionally, review and sanitize any dynamic route parameters passed to ssgParams to avoid path traversal sequences such as '../'.

Avoid using untrusted input in static site generation parameters during build time.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

The vulnerability allows unauthorized file writes outside the intended output directory during static site generation, which could lead to overwriting unintended files or corrupting deployment outputs.

However, there is no direct impact on confidentiality or availability, and the issue is limited to build-time static site generation with local attack vector and high attack complexity.

Based on the provided information, there is no explicit mention of effects on compliance with common standards and regulations such as GDPR or HIPAA.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart