Hanami 2.3 released

hanami-controller 2.3.3

Fixed

  • Accept the CSRF token from a form body in routed requests. With the fix for GHSA-55j2-5pph-56mv alone, the String keys of query string and form body params were dropped from params.raw when Hanami Router also gave them as route params, so CSRF protection could not find _csrf_token and rejected every form submission. Both keys are now kept, with the same value. (@parndt in #537)

Security

  • Give route params precedence over query string and form body params with the same name in actions with a contract. Route params have Symbol keys and the others have String keys, so both were kept and the contract read the query or form value, letting ?id=2 override the :id in /users/1. (@parndt in GHSA-55j2-5pph-56mv)

Compare v2.3.2 … v2.3.3


View release on GitHub

hanami-router 2.3.2

Fixed

  • Fix a memory leak where the router kept every request path it received in memory. (@aaronmallen in #312)

Security

  • Apply a scope’s middleware to all of its paths when it contains a nested scope or slice with its own middleware. Previously, paths in the outer scope that weren’t in the nested scope skipped the outer scope’s middleware, such as authentication. (@parndt in GHSA-73j7-6jvw-2v7g)
  • Stop concurrent requests to the same route from receiving each other’s path params. Matching a route stored the captured params on the route itself, so a thread switch between matching and reading them could give one request another’s params. (@parndt in GHSA-wgjv-fq27-94m7)

Compare v2.3.1 … v2.3.2


View release on GitHub

hanami-webconsole 2.3.2

Security

  • Decide whether a request may reach the console from REMOTE_ADDR alone, overriding BetterErrors’ check. Previously, X-Forwarded-For, Client-IP and Forwarded headers were trusted from peers on private networks, so anyone on the same network could claim a loopback address and run code in the app. Requests without a REMOTE_ADDR are now denied. (@parndt in GHSA-qxv3-3w54-whwp)

View release on GitHub

hanami-view 2.3.2

Fixed

  • Ensure Hanami::View::ERB::Engine is still used for .html.erb templates with Tilt 2.9. (@timriley in #284)

Security

  • Percent-encode quotes, backticks, angle brackets and spaces in the result of sanitize_url. Previously a decoded ' was returned as-is in an HTML-safe string, breaking out of single-quoted attributes. (@parndt in GHSA-4g74-pv6p-g8hw)

View release on GitHub