Skip to content

esrun@0.47.0

Latest

Choose a tag to compare

@github-actions github-actions released this 11 Nov 11:20
· 56 commits to main since this release
2bed609

Added

  • fetch(url, { decompress: false }) (DECISIONS D210), Bun's init member:
    a compressed response body arrives as the server sent it, with
    Content-Encoding and Content-Length intact, and the request asks for
    identity unless it sets its own Accept-Encoding. For a stored object whose
    coding is part of it (an S3 object saved gzipped), a byte-exact proxy, or a
    checksum over the wire bytes.

  • runtime:websocket's serve() serves wss: with secureTransport: "on",
    cert and key, like runtime:http's serve.

  • --proxy=<url> and --no-proxy=<list> (DECISIONS D205): fetch, the
    WebSocket client and the --otel exporter go through an http:// or
    https:// forward proxy — http: targets forwarded, https:/ws:/wss:
    tunnelled with CONNECT, credentials from the URL sent as
    Proxy-Authorization and never printed. --allow-net still judges the
    target. Exceptions take domains, IPs, CIDR blocks and host:port;
    loopback always goes direct. No environment variable is read: esrun warns
    when HTTP(S)_PROXY is set. A refused tunnel is the new code
    ERR_PROXY_TUNNEL.

  • serve({ onError(error, request) }) (DECISIONS D206): answers for a
    handler that threw or returned no Response. Without it the 500's report
    now names the request: runtime:http: GET /path failed (trace …), the query
    left out.

  • --otel reports the outcome of a request: its span carries
    http.response.status_code and error.type and is ERROR for a 5xx or a
    throw, and http.server.request.duration is exported to /v1/metrics —
    counted before sampling. A request span used to close OK whatever happened.

  • The WebSocket client has the 30s connect deadline fetch has, and its
    connect errors carry codes (ERR_DNS, ERR_CONNECTION_REFUSED, ERR_TLS,
    ERR_TIMED_OUT).

  • runtime:pdf sanitize profiles and categories (otf-pdf 0.2):
    sanitize({ profile: "basic" | "privacy" | "strict" | "all" }), and
    comments, hiddenAnnotations, thumbnails, navigation, webCapture,
    structure, hiddenLayers and invisibleText, each counted by
    sanitizeReport. Hidden layers and invisible text are cut from page
    content without moving the visible text. The defaults are unchanged.

Changed

  • The minimum supported Rust version is 1.97, up from 1.96: oxc 0.157, which
    esdev builds with, requires it.

  • runtime:serialization moves to quick-xml 0.42 and toml 1.2. XML input
    nested more than 65,535 elements deep is refused instead of overflowing the
    parser's depth counter; output is unchanged (the writer is our own). esdev's
    HTML splicing moves to html5gum 0.9.

  • brotli 9 (with async-compression 0.4.52) and base64 0.23: one copy of
    each in the binary, matching what bcrypt and the bundler already use. No
    change in behaviour.

  • runtime:websocket moves to tungstenite 0.30: a server refuses a
    handshake whose Sec-WebSocket-Key is not a valid 16-byte key, as RFC 6455
    requires, and large messages read faster. The last copy of the older
    digest crates leaves the binary with it.

  • Password hashing moves to argon2 0.6 and scrypt 0.12, on the same
    digest generation as the rest of the crypto stack, so the older sha2,
    hmac, pbkdf2 and blake2 copies leave the binary. Hashes are written in
    the same PHC format and verify in both directions across the upgrade.

Fixed

  • On Windows, the warning that a proxy variable is ignored names it once:
    HTTP_PROXY and http_proxy are one variable there, and the warning listed
    both.

  • runtime:http keeps a handler's Content-Length on the answer to a HEAD,
    so new Response(null, { headers: { "content-length": "1234" } }) tells the
    client the size a GET would return (RFC 9110 §9.3.2), as Deno does. It was
    dropped, leaving no length at all. Only a plain decimal is kept, and only for
    HEAD; every other response is still framed from its body.

  • fetch with a Range header sends Accept-Encoding: identity, as the Fetch
    standard says (D210), instead of leaving the header out — which accepted any
    coding, so a server could compress the range into a body that cannot be
    decoded.

  • runtime:pdf: a page whose content stream exceeds maxDecodedSize fails
    with ERR_PDF_LIMIT instead of reading as an empty page, and pageText
    reuses the fonts an earlier call loaded on the same document (otf-pdf 0.2).

  • A response the server cut short fails fetch with ERR_CONNECTION_RESET
    and "the connection closed before the response completed", instead of the
    HTTP client's chain of wrappers.

Removed

  • esrun upgrade (DECISIONS D204). A deployment pins its esrun in its
    image or install step; on a development machine, esdev upgrade now
    updates esrun and esdev together. esrun upgrade exits with an error that
    names both routes. To upgrade an esrun-only machine, re-run the installer
    with ESRUN_VERSION=<version>.

Security

  • rustix 1.1.6, for RUSTSEC-2026-0486 (GHSA-jh2m-fhpj-3vr7): its xattr
    functions marked unwritten bytes as initialized. Neither binary calls them.
  • copy can no longer be pointed outside the root jail. It checked both
    paths when called and opened them by name when it ran, so a copy issued
    with a rename of its directory and a symlink out of the jail in the same
    tick read a file outside the root, or wrote one there. Both ends are now
    pinned by descriptor at the call, like every other mutation. stat,
    exists, readDir, glob scans and makeTempFile/makeTempDir are pinned
    the same way, which closes the same window for threads racing each other.
  • No op hands a worker's entry source back to JavaScript. Starting a worker
    was two ops, and the first, reachable from guest code through __ops,
    returned the entry's text: under --allow-imports alone it read any text
    file in the project, .env included, whatever --allow-read said. The
    spawn now reads the entry itself. A worker refused for want of workers
    says that starting it is what needs the grant.
  • An import loads only a module file (DECISIONS D209). Any other file —
    .env, config.yaml, notes.txt, an extensionless name — is refused
    with the new code ERR_UNKNOWN_FILE_EXTENSION before it is read. The
    loader used to run whatever a specifier named as JavaScript: a YAML mapping
    is a valid script, and a trap on the global object collected every value in
    it, so --allow-imports read project files that --allow-read did not
    grant. A module file is .js, .mjs, .cjs, .json (with
    type: "json") or .wasm; the file you run, and import.meta.resolve(),
    are unaffected.
  • --allow-run=<program> no longer admits every name of a multi-call
    binary.
    Entries were matched on the real file alone, and on Alpine ls
    and sh are both links to busybox — so --allow-run=ls ran sh -c …. The
    name a program is invoked by must now match as well as the file.
  • crypto.subtle RSA is constant-time (DECISIONS D203). It moves to
    RustCrypto rsa 0.10.0-rc.20, which fixes RUSTSEC-2023-0071 ("Marvin"):
    constant-time private-key arithmetic, blinded signing and decryption, and
    implicit rejection. All RSA randomness still comes from the injected
    entropy provider. RSA-OAEP labels may now be any bytes; generateKey
    refuses a modulus outside 1024–8192 bits, and importKey refuses an RSA
    key under 1024 bits with a DataError. Checked against OpenSSL-generated
    keys, signatures and ciphertexts in both directions.