OpenAIHonoApr 7, 2026, 4:15 AM

v4.12.12

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.12 — Security fixes for static serving, SSG, cookies, and IP restriction

Key Points

  • Serve Static bypass via repeated slashes fixed
  • toSSG path traversal write-out patched
  • Cookie-name and IPv4-mapped IPv6 IP fixes

Summary

Release v4.12.12 (2026-04-07) addresses multiple security issues affecting Serve Static middleware, Static Site Generation (toSSG), cookie utilities, and IP restriction middleware. If your application uses any of these features you should upgrade to v4.12.12 promptly.

Key Points

  • Serve Static: fixes a path-normalization inconsistency where repeated slashes (//) could bypass route-based middleware and expose protected static files. (GHSA-wmmm-f939-6g9c)
  • toSSG: patches a path traversal that allowed crafted ssgParams to write files outside the configured output directory. (GHSA-xf4j-xp2r-rqqx)
  • IP restriction: corrects incorrect matching for IPv4-mapped IPv6 addresses (e.g. ::ffff:127.0.0.1) that could bypass allow/deny rules. (GHSA-xpcf-pg52-r92g)
  • Cookies: adds validation on cookie write paths (setCookie(), serialize(), serializeSigned()) and fixes a non-breaking-space prefix bypass in getCookie() that could allow attacker-controlled cookies to override legitimate ones. (GHSA-26pp-8wgv-hjvm, GHSA-r5rp-j6wh-rvv4)
  • Impact: users of Serve Static, toSSG, cookie utilities, or ipRestriction are strongly encouraged to upgrade.

Upgrade guidance (practical)

  • Upgrade to hono v4.12.12 and pin the dependency in your lockfile.
  • Audit and normalize incoming paths used by static serving and SSG output generation.
  • Validate SSG output paths to ensure they stay inside the configured output directory.
  • Review cookie name handling on both read and write paths; ensure application-level validation of cookie names if necessary.
  • Verify IP restriction rules against IPv4-mapped IPv6 addresses.

References

  • See GHSA IDs referenced above and the v4.12.12 release notes for details.

Full Translation

Translations

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

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

v4.12.12

v4.12.12

  • 公開日: 2026-04-07T04:15:34.000Z
  • リリース: yusukebe
  • コミット: c37ba26

セキュリティ修正

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

  • Middleware bypass via repeated slashes in serveStatic

    • 影響範囲: Serve Static ミドルウェア
    • 内容: パス正規化の不整合を修正しました。連続スラッシュ(//)によってルートベースのミドルウェア保護を回避し、保護された静的ファイルへアクセスされる可能性がありました。
    • アドバイザリ: GHSA-wmmm-f939-6g9c
  • Path traversal in toSSG() allows writing files outside the output directory

    • 影響範囲: toSSG()(Static Site Generation)
    • 内容: 細工された ssgParams により、設定された出力ディレクトリの外にファイルを書き出せてしまうパス・トラバーサル問題を修正しました。
    • アドバイザリ: GHSA-xf4j-xp2r-rqqx
  • Incorrect IP matching in ipRestriction() for IPv4-mapped IPv6 addresses

    • 影響範囲: IP Restriction ミドルウェア
    • 内容: IPv4-mapped IPv6 アドレス(例: ::ffff:127.0.0.1)の取り扱いが不適切で、allow/deny ルールを回避される可能性がありました。正しいマッチングを行うよう修正しました。
    • アドバイザリ: GHSA-xpcf-pg52-r92g
  • Missing validation of cookie name on write path in setCookie()

    • 影響範囲: setCookie(), serialize(), serializeSigned()hono/cookie
    • 内容: 書き込み時のクッキー名検証が漏れており、パース時とシリアライズ時で扱いが一致しない問題を修正しました。
    • アドバイザリ: GHSA-26pp-8wgv-hjvm
  • Non-breaking space prefix bypass in cookie name handling in getCookie()

    • 影響範囲: getCookie()hono/cookie
    • 内容: ノーブレークスペース(NBSP)プレフィックスによるクッキー名処理の不一致を修正しました。攻撃者制御のクッキーが正当なクッキーを上書きし、プレフィックス保護を回避する可能性がありました。
    • アドバイザリ: GHSA-r5rp-j6wh-rvv4

推奨

Serve Static、Static Site Generation、Cookie ユーティリティ、または IP Restriction ミドルウェアを利用しているユーザーは、このバージョンへのアップグレードを強く推奨します。

アセット

  • Assets: 2

(注)リリースの詳細やアドバイザリの参照は、該当する GHSA ID を確認してください。