REDHAT-BUG-2572861: Medium severity npm/hono vulnerability
Hono is a Web application framework that provides support for any JavaScript runtime. From 3.12.0 until 4.13.16, the css helper in hono/css escapes interpolated string values separately and therefore fails to neutralize a closing style tag when < ends the template text or a preceding value and / begins the next attacker-controlled value. During server-side rendering, the combined output can close the <Style /> element early and cause the remainder of the interpolated value to be interpreted as HTML. Applications that place an untrusted string immediately after < in a css template, including adjacent untrusted interpolations, can expose viewers to attacker-controlled HTML or script and information accessible to that page. Other uses of the css helper are not affected. This issue is fixed in version 4.13.16.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 4.13.16
Event History
Frequently Asked Questions
Which applications are actually exposed to this issue?
Only applications using Hono's css helper during server-side rendering are affected, and only when an untrusted string is placed immediately after a < character in a css template. This includes cases where < ends the template text or a preceding interpolated value and / begins the next attacker-controlled interpolation.
What must an attacker control to exploit it?
An attacker must be able to supply a value used in the vulnerable css template position. The resulting combined output must form a closing style tag, allowing the remaining attacker-controlled content to be interpreted as HTML or script by viewers.
Are all uses of the css helper affected?
No. Other uses of the css helper are not affected; the vulnerable condition is limited to the specified placement of untrusted interpolated strings around a < and / sequence.
What version fixes the problem?
The issue is fixed in Hono version 4.13.16. Affected versions are from 3.12.0 until 4.13.16.