OpenAIHonoMay 19, 2026, 11:41 AM

v4.12.21

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

openaienmodel: gpt-5-mini-2025-08-07

v4.12.21

Key Points

  • app.mount percent-encoding fix
  • IPv6 deny-bypass resolved
  • Set-Cookie and JWT validation hardened

Summary

This release (2026-05-19) is a security patch addressing multiple vulnerabilities across hono core and plugins. It fixes incorrect mount prefix stripping for percent-encoded paths, IPv6 bypasses in IP restriction checks, Set-Cookie attribute injection, and missing scheme validation in JWT auth.

Key Points

  • Affected packages: app.mount(), hono/ip-restriction, hono/cookie, hono/jwt and hono/jwk.
  • app.mount(): now strips the mount prefix using the raw URL pathname to avoid incorrect routing when percent-encoded characters are present.
  • IP restriction: fixed IPv6/address comparison so non-canonical IPv6 representations (compressed, hex IPv4-mapped) no longer bypass static deny rules.
  • Cookie helper: validates sameSite and priority against injection characters (";", CR, LF) to prevent Set-Cookie header injection.
  • JWT middleware: enforces that the Authorization header uses the Bearer scheme; other two-part schemes will no longer be treated as valid.
  • Recommended action: upgrade to v4.12.21 immediately if you use any of the affected features.

Practical notes for engineers

  • If you cannot upgrade immediately:
    • Avoid mounting apps using percent-encoded mount prefixes or normalize/validate paths before mount.
    • Normalize IPv6 addresses for comparison (use canonical/binary form) or place IP filtering behind a trusted proxy.
    • Sanitize / whitelist sameSite and priority values before passing to the cookie helper.
    • Enforce Authorization: Bearer ... validation in front of or within your auth middleware.

References

  • GHSA-2gcr-mfcq-wcc3, GHSA-xrhx-7g5j-rcj5, GHSA-3hrh-pfw6-9m5x, GHSA-f577-qrjj-4474

Full Translation

Translations

A translation section that keeps the flow of the original article.

openaijamodel: gpt-5-mini-2025-08-07

v4.12.21

v4.12.21

公開日: 2026-05-19T11:41:00.000Z リリース担当: yusukebe

概要

  • このリリースには以下のセキュリティ修正が含まれます。

セキュリティ修正

  • app.mount() がパーセントエンコードされたパスで不正なルーティングを引き起こすプレフィックス削除

    • 影響: app.mount()
    • 修正: デコード済みのパスではなく、生の URL pathname を使用してプレフィックスの削除を行うよう修正しました。マウントプレフィックスやパスにパーセントエンコードされた文字が含まれる場合、誤った位置でプレフィックスが削除され、サブアプリケーションが不正なパスを受け取る可能性がありました。
    • GHSA-2gcr-mfcq-wcc3
  • IP Restriction が非正規の IPv6 に対して静的 deny ルールをバイパスする

    • 影響: hono/ip-restriction
    • 修正: 文字列等価での比較をやめ、IP アドレス比較を修正しました。圧縮表現や 16 進表記の IPv4 マップアドレスなどの非正規な IPv6 表現によって拒否対象のアドレスがバイパスされる可能性がありました。
    • GHSA-xrhx-7g5j-rcj5
  • Cookie ヘルパーが sameSitepriority をサニタイズせず、Set-Cookie インジェクションを許す

    • 影響: hono/cookie
    • 修正: sameSitepriority オプションに対するインジェクション文字(;, ,, \r, \n)の検証を追加しました。これらのオプションにユーザー制御の入力が渡された場合、Set-Cookie レスポンスヘッダへ追加属性が注入される可能性がありました。
    • GHSA-3hrh-pfw6-9m5x
  • JWT ミドルウェアが Bearer 以外の Authorization スキームを受け付ける

    • 影響: hono/jwt, hono/jwk
    • 修正: Authorization ヘッダのスキーム検証を追加しました。スキーム名に関係なく2パートのヘッダ値が受け入れられていたため、非 Bearer スキームが JWT 認証を通過してしまう可能性がありました。
    • GHSA-f577-qrjj-4474

推奨

  • app.mount(), hono/ip-restriction, hono/cookie, hono/jwt / hono/jwk を使用しているユーザーは、このバージョンにアップグレードすることを推奨します。

その他

  • Assets: 2
  • リアクション: ❤️ 2、🚀 4