CVE-2026-39408: Hono Path Traversal Vulnerability
MODERATECVE-2026-39408 is a MODERATE path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Hono libraries in the npm ecosystem. The issue involves path traversal in tossg() allows writing files outside the output directory. Remediation is available by upgrading affected packages to version 4.12.12.
CVE-2026-39408 at a Glance
How to Fix CVE-2026-39408
To remediate this vulnerability, upgrade all affected Hono dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install hono@4.12.12
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls hono
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-39408, inspect your project dependencies using npm:
npm ls hono
Analyze the terminal output to locate any version of Hono in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.12.12), your application is affected.
Note: The npm ls hono command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where 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. In Hono, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-39408 Affected Hono Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
hono
|
npm |
≥ 4.0.0
< 4.12.12
|
4.12.12
|
References
Frequently Asked Questions
What is CVE-2026-39408?
Which Hono versions are affected?
What version fixes CVE-2026-39408?
Is hono affected?
What CWE is associated with CVE-2026-39408?
How can I check npm dependencies for CVE-2026-39408?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xf4j-xp2r-rqqx",
"modified" : "2026-04-08T15:34:35Z",
"published" : "2026-04-08T00:16:51Z",
"aliases" : [ "CVE-2026-39408" ],
"summary" : "Hono: Path traversal in toSSG() allows writing files outside the output directory",
"details" : "## Summary\n\nA 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.\n\n## Details\n\nThe 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.\n\nFor example:\n \n```ts\nimport { Hono } from 'hono'\nimport { toSSG, ssgParams } from 'hono/ssg'\n\nconst app = new Hono()\n\napp.get('/:id', ssgParams([{ id: '../pwned' }]), (c) => {\n return c.text('pwned')\n})\n\ntoSSG(app, fs, { dir: './static' })\n```\n\nIn this case, the generated output path may resolve outside `./static`, resulting in a file being written outside the intended output directory.\n\n## Impact\n\nAn attacker who can influence values passed to `ssgParams` during the build process may be able to write files outside the intended output directory.\n\nDepending on the build and deployment environment, this may:\n\n* overwrite unintended files\n* affect generated artifacts\n* impact deployment outputs or downstream tooling\n\nThis issue is limited to build-time static site generation and does not affect request-time routing.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "hono"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0"
}, {
"fixed" : "4.12.12"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.12.11"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/honojs/hono/security/advisories/GHSA-xf4j-xp2r-rqqx"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-39408"
}, {
"type" : "WEB",
"url" : "https://github.com/honojs/hono/commit/b470278920fffcfd6d76002755d6db53db827679"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/honojs/hono"
}, {
"type" : "WEB",
"url" : "https://github.com/honojs/hono/releases/tag/v4.12.12"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-08T00:16:51Z",
"nvd_published_at" : "2026-04-08T15:16:14Z"
}
}