Skip to content

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 03 Nov 23:23
· 67 commits to main since this release
90eb610

mimicry v0.3.0

Chrome and Firefox on iPhone, a fix for a credential leak on redirects, URLs normalised the way browsers do, and closer browser behaviour for compressed bodies, refused streams, bodiless uploads, 0-RTT and HelloRetryRequest.

Behaviour changes

These don't change the API, but a request can now go out differently than in v0.2.0:

  • Authorization is dropped once a redirect changes origin (a non-navigation request: a fetch, an XHR and the like). Before, a redirect to another origin, a subdomain included, kept the header: the token reached the new origin, and a CORS preflight went out that no browser sends. The Fetch standard deletes it, and Chrome 156 does. Navigations still refuse page-set headers after a cross-origin redirect, as before. (#51, #68)

  • Request URLs are normalised as a browser's URL parser leaves them (the WHATWG URL Standard), on the first request, every redirect hop and WebSocket URLs:

    • the host is lowercased, and a non-ASCII host becomes its punycode form (bücher.de → xn--bcher-kva.de);
    • the scheme's default port is dropped;
    • the query is percent-encoded with the standard's query set.
    • SNI, the connection pool, cookies, Origin and Referer all use that form, and resp.Request.URL is the URL sent.
    • Before, https://Example.COM:443/ sent an uppercase SNI and opened its own connection, an IDN host failed with invalid host, and a raw space in a query broke the HTTP/2 connection.
    • A host UTS #46 rejects is now an error rather than being sent.
    • ' in a query is left as written until browsers are measured (#71).

    (#48, #49, #50, #69)

  • A compressed body's Close returns at once and finishes the transport in the background (up to 4 KB, for up to 1 s). (#53, #70)

New profiles

  • chrome-157-ios (profiles.ChromeIOS()): Chrome 157 on an iPhone. (#57, #59)
  • firefox-159-ios (profiles.FirefoxIOS()): Firefox 159 on an iPhone. (#58, #66)

Both run on WebKit, like Safari, but send their own user agent and headers. Both are captured on a real iPhone; their gaps are in profiles/EVIDENCE.md and decision 0053. A profile's name carries the browser's version, not the OS's.

Wire behaviour

  • Compressed bodies:

    • after a br or deflate body, HTTP/2 no longer sends RST_STREAM CANCEL, and HTTP/1.1 no longer drops the connection;
    • the stream now ends as it does in the browser, and the HTTP/1.1 connection is reused;
    • Content-Encoding: deflate bodies without a zlib header now decode, as in Chrome.

    (#53, #54, #70)

  • 0-RTT: a resumed QUIC hello offers early_data only when the session ticket allows 0-RTT, as BoringSSL and NSS do. Before, it was offered to every server, giving Chrome and Safari a wrong extension count and JA4 on servers without 0-RTT. (#52, #67)

  • REFUSED_STREAM:

    • an HTTP/2 refused stream is resent on the same connection, which stays pooled;
    • the number of sends is the browser's: Chrome sends 3, Firefox 10;
    • a request whose body had started sending is never resent.
    • Safari, the iPhone profiles and Chrome 155 are unmeasured and keep moving to a new connection.

    (#55, #72)

  • Bodiless POST and PUT send content-length: 0 over HTTP/2 and HTTP/3, placed and framed as each browser does:

    • Chrome: after the pseudo-headers;
    • Firefox: last, with an empty DATA frame ending the HTTP/2 stream;
    • Safari: on PATCH too.

    (#56, #75)

  • HelloRetryRequest cookie: after a HelloRetryRequest, the cookie extension goes where the browser puts it:

    • Firefox: after signature_algorithms;
    • Safari: after supported_versions;
    • Chrome: shuffled with its other extensions.

    Before, it went at a random position, which a fixed-order browser never uses. (#61, #77; uTLS fork roachadam/utls#16)

The last three need a capture scenario that's new in this release. Profiles without it (Windows, the iPhone profiles, Chrome 155, Safari 26) keep their v0.2.0 behaviour for these; this is listed in profiles/EVIDENCE.md.

Profiles and tooling

  • QUIC fallback: one rule now explains, across every profile's captures, when a browser abandons a QUIC attempt that got no answer:

    • Safari, Chrome on iOS and Firefox on iOS: once the request is on TCP;
    • desktop Chrome and Firefox: never.
    • The profile generator uses that rule, chrome-157-ios's hand-set value is now derived, and no profile's value changed.

    (#60, #74)

  • Release watch: a weekly workflow keeps one issue open while Chrome, Firefox or Safari ships a version newer than the newest profile, or while Chrome's root store trust anchors differ from its profiles'. (#63, #73)

Fixes

  • A race in a refused-stream test that failed on slow CI runners. (#78)
  • CI's test shards are re-balanced, so the full run on main finishes within its time limit again. (#79)