Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rack/rack
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.1.20
Choose a base ref
...
head repository: rack/rack
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.1.21
Choose a head ref
  • 19 commits
  • 19 files changed
  • 6 contributors

Commits on Mar 30, 2026

  1. Configuration menu
    Copy the full SHA
    f7e6c57 View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2026

  1. Root directory disclosure via unescaped regex interpolation in `Rack:…

    …:Directory`.
    
    Escape the root path before interpolating into a regular expression,
    preventing RegexpError when the root contains metacharacters and
    avoiding path disclosure when regex silently mismatches.
    haruki0409 authored and ioquatix committed Mar 31, 2026
    Configuration menu
    Copy the full SHA
    29b17c5 View commit details
    Browse the repository at this point in the history
  2. Avoid O(n^2) algorithm in Rack::Utils.select_best_encoding

    If a wildcard has already been seen as an acceptable encoding,
    ignore additional wildcards.
    
    Other improvements while here:
    
    * Only process up to 16 encodings.
    
    * Improve efficiency of candidate sorting.
    
    Add tests for:
    
    * Lower but non-zero wildcard priority
    
    * Multiple wildcards with different priorities
    ioquatix committed Mar 31, 2026
    Configuration menu
    Copy the full SHA
    55db26e View commit details
    Browse the repository at this point in the history
  3. Parse Forwarded header instead of using regexp scan

    `;` and `,` are allowed as characters inside a quoted value of a
    forwarded parameter. So you cannot safely split on those and then
    try to remove quotes.
    
    Switch to using a parser based on the one used for parsing
    multipart content-disposition.
    ioquatix committed Mar 31, 2026
    Configuration menu
    Copy the full SHA
    9df5d34 View commit details
    Browse the repository at this point in the history
  4. Raise error for multipart requests with multiple boundary parameters

    RFC 1341 specifies there should be a single boundary parameter.
    Requests with multiple boundary parameters are unlikely to be
    legitimate, and likely are attempts to exploit parsing differences
    between rack and web application firewalls.
    
    * Disallow whitespace between boundary and = when parsing multipart boundaries
    
    Rack has historically not accepted these. To avoid security issues
    when parsing multiple boundaries, check for boundary cases that may
    have whitespace, but explicitly disallow the parsing if there is
    whitespace.
    jeremyevans authored and ioquatix committed Mar 31, 2026
    Configuration menu
    Copy the full SHA
    1062653 View commit details
    Browse the repository at this point in the history
  5. Fix header_rules bypass via URL-encoded paths.

    Decode path once in applicable_rules before matching, fixing:
    - URL-encoded paths bypassing :fonts, Array, and Regexp header rules.
    - Path mutation across rules when String rule unescapes inside find_all.
    - Array rule values interpolated into regexp without Regexp.escape.
    haruki0409 authored and ioquatix committed Mar 31, 2026
    Configuration menu
    Copy the full SHA
    84937c3 View commit details
    Browse the repository at this point in the history
  6. Use String#bytesize for Content-Length in error responses.

    `String#size` returns character count, not byte count. For responses
    containing multi-byte UTF-8 characters, this produces an incorrect
    `Content-Length` value, violating RFC 9110 Section 8.6.
    ioquatix committed Mar 31, 2026
    Configuration menu
    Copy the full SHA
    c3645d3 View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2026

  1. Use a default limit of 100 byte ranges

    Allow exceeding this limit by passing max_ranges keyword argument.
    
    If the limit is exceeded, return nil, treating the request as not
    requesting ranges. This seems better than returning [], which would
    treat the request as requesting no ranges. We use [] when the total
    size exceeds the size of the file, as such case is obviously a
    problem. However, a request with more than the given number of
    ranges is not obviously a problem.
    jeremyevans authored and ioquatix committed Apr 1, 2026
    Configuration menu
    Copy the full SHA
    345a4cf View commit details
    Browse the repository at this point in the history
  2. Change Rack::Request::AUTHORITY to only match RFC allowed characters

    RFC 9110 specifies that allowed characters in a Host header come
    from RFC 3986 Section 3.2.2, which provides the following ABNF:
    
    ```
          host        = IP-literal / IPv4address / reg-name
    
          reg-name    = *( unreserved / pct-encoded / sub-delims )
    
          unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"
    
          pct-encoded = "%" HEXDIG HEXDIG
    
          sub-delims  = "!" / "$" / "&" / "'" / "(" / ")"
                      / "*" / "+" / "," / ";" / "="
    ```
    
    This limits the allowed characters to those characters.
    
    This breaks a spec that tests for internationalized domain names.
    Such a spec is incorrect as internationalized domain names must be
    encoded via punycode in Host headers, so update the specs to
    correctly test for the punycode versions.
    jeremyevans authored and ioquatix committed Apr 1, 2026
    Configuration menu
    Copy the full SHA
    c49558a View commit details
    Browse the repository at this point in the history
  3. Only do a simple substitution on the x-accel-mapping paths

    Mention the substitution is case insensitive in the documentation,
    since if the file system is case sensitive, this would be unexpected.
    jeremyevans authored and ioquatix committed Apr 1, 2026
    Configuration menu
    Copy the full SHA
    59a0966 View commit details
    Browse the repository at this point in the history
  4. Fix root prefix bug in Rack::Static

    This is similar to the fix of CVE-2026-22860 for Rack::Directory.
    jeremyevans authored and ioquatix committed Apr 1, 2026
    Configuration menu
    Copy the full SHA
    a17cb99 View commit details
    Browse the repository at this point in the history
  5. Add Content-Length size check in Rack::Multipart::Parser

    Compare the declared `Content-Length` against a configurable maximum (`PARSER_BYTESIZE_LIMIT`) before any parsing begins.
    
    If it exceeds the limit, raise an exception immediately.
    th4s1s authored and ioquatix committed Apr 1, 2026
    Configuration menu
    Copy the full SHA
    367a2a0 View commit details
    Browse the repository at this point in the history
  6. Limit the number of quoted escapes during multipart parsing

    This sets a default limit of 8192 escapes, which can be modified
    using the RACK_MULTIPART_CONTENT_DISPOSITION_QUOTED_ESCAPES_LIMIT
    environment variable.
    jeremyevans authored and ioquatix committed Apr 1, 2026
    Configuration menu
    Copy the full SHA
    17ce783 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2856934 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    176f468 View commit details
    Browse the repository at this point in the history
  9. Fix test expectation.

    samuel-williams-shopify authored and ioquatix committed Apr 1, 2026
    Configuration menu
    Copy the full SHA
    c59d924 View commit details
    Browse the repository at this point in the history
  10. Add logger to gemfile.

    ioquatix committed Apr 1, 2026
    Configuration menu
    Copy the full SHA
    fd1c23d View commit details
    Browse the repository at this point in the history
  11. Fix typo in test.

    ioquatix committed Apr 1, 2026
    Configuration menu
    Copy the full SHA
    87961c3 View commit details
    Browse the repository at this point in the history
  12. Bump patch version.

    ioquatix committed Apr 1, 2026
    Configuration menu
    Copy the full SHA
    ae84311 View commit details
    Browse the repository at this point in the history
Loading