Summary
Workarounds
Don't use TrieRouter directly.
// DON'T USE TrieRouter
import { TrieRouter } from 'hono/router/trie-router'
const app = new Hono({ router: new TrieRouter() })
References
Router options on the Hono website: https://hono.dev/api/hono#router-option
Impact
The clients may override named path parameter values from previous requests if the application is using TrieRouter. So, there is a risk that a privileged user may use unintended parameters when deleting REST API resources.
TrieRouter is used either explicitly or when the application matches a pattern that is not supported by the default RegExpRouter.
The code to reproduce it. The server side application:
import { Hono } from 'hono'
import { TrieRouter } from 'hono/router/trie-router'
const wait = async (ms: number) => {
return new Promise((resolve) => {
setTimeout(resolve, ms)
})
}
const app = new Hono({ router: new TrieRouter() })
app.use('*', async (c, next) => {
await wait(Math.random() * 200)
return next()
})
app.get('/modules/:id/versions/:version', async (c) => {
const id = c.req.param('id')
const version = c.req.param('version')
console.log('path', c.req.path)
console.log('version', version)
return c.json({
id,
version,
})
})
export default app
The client code which makes requests to the server application:
const examples = [
'http://localhost:8787/modules/first/versions/first',
'http://localhost:8787/modules/second/versions/second',
'http://localhost:8787/modules/third/versions/third',
]
const test = () => {
for (const example of examples) {
fetch(example)
.then((response) => response.json())
.then((data) => {
const splitted = example.split('/')
const expected = splitted[splitted.length - 1]
if (expected !== data.version) {
console.error(`Error: exprected ${expected} but got ${data.version} - url was ${example}`)
}
})
}
}
test()
The results:
Error: exprected second but got third - url was http://localhost:8787/modules/second/versions/second
Error: exprected first but got third - url was http://localhost:8787/modules/first/versions/first
Untrusted input is evaluated as executable code within the application's runtime environment. Typical impact: arbitrary code execution within the application's privilege context.
CVE-2023-50710 has a CVSS score of 4.2 (Medium). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (3.11.7); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
"v3.11.7" includes the change to fix this issue.
Frequently Asked Questions
- What is CVE-2023-50710? CVE-2023-50710 is a medium-severity code injection vulnerability in hono (npm), affecting versions < 3.11.7. It is fixed in 3.11.7. Untrusted input is evaluated as executable code within the application's runtime environment.
- How severe is CVE-2023-50710? CVE-2023-50710 has a CVSS score of 4.2 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of hono are affected by CVE-2023-50710? hono (npm) versions < 3.11.7 is affected.
- Is there a fix for CVE-2023-50710? Yes. CVE-2023-50710 is fixed in 3.11.7. Upgrade to this version or later.
- Is CVE-2023-50710 exploitable, and should I be worried? Whether CVE-2023-50710 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2023-50710 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2023-50710? Upgrade
honoto 3.11.7 or later.