Xo is experimental. The source is now public on GitHub, or try Xo in your browser.

Xo 0.51 release notes

released 2026-11-13 · tag v0.51.1 · all releases

Downloads: Xo 0.51.1 on GitHub, with archives for macOS (Apple silicon and Intel, signed and notarized), Linux (arm64 and x86-64), and Windows (x86-64, Authenticode signed), and a SHA256SUMS file.

0.51.1 (2026-11-14)

Xo 0.51.1 is a security release over 0.51.0. It fixes three ways a small, hostile compressed input could make an Xo program use far more memory or CPU than the input’s size: an HTTP client reading a gzip response, a program streaming DEFLATE, gzip or zlib through compress.Decompressor, and xo mod or any program extracting a zip. It also fixes two faults a request could trigger: a Date or Civil with an extreme year, as a JSON request body can hold, stopped the program in several of its methods, and so did a long numeric character reference given to html.unescape_string. Nothing else changes.

Upgrade advice: upgrade if your programs decode a Date or Civil from input you do not control (a JSON request body, for instance), unescape HTML text from peers, make HTTP requests to servers you do not control, decode compressed data from peers, or fetch modules through a proxy you do not run.

Security

  • std/compress (native backends): a Decompressor write held about 16 bytes of memory for each byte it decoded, and one write returns all the output its input completes. About 62 KB of hostile gzip made one write hold 1 GB, and the default max_size of 1 GiB allowed about 16 GiB. Output is now copied once: a write inflating 1.3 MB to 206 MB peaked at 3.34 GB, now 420 MB. One DEFLATE block fed in small writes also cost quadratic time, because the block was decoded again from its start on every write: a 4 MB block in 16 KB writes took 2706 ms, now 56 ms (a hostile 64 MB block took about 11 minutes of CPU). Input written after a zlib or raw DEFLATE stream ends is now dropped instead of kept, and a Decompressor’s first error is returned by every later write and finish without decoding, as Go’s readers keep theirs. Found by the std/compress security review (decision 0616).
  • std/http client (native backends): a streaming read of a gzip response gave each received chunk to the decoder in one write, so about 1 MB of hostile gzip could ask for up to 1 GiB of output at once. The body now goes to the decoder 4 KiB at a time, so one step’s output stays near 4 MB: reading a 1000 MB gzip bomb of about 1 MB with ClientStream.read took 6.4 GB of memory and 6.1 s in 0.51.0, and takes 23 MB and 0.8 s now.
  • std/archive and xo mod: unzip inflated a deflated file to its end before checking its declared size, and unzip and gunzip had no output limit. A 204 KB zip whose one file declares 100 bytes took 276 MB of memory for 200 MB of output; now 3.6 MB, with Go’s error (zip: not a valid zip file). unzip and gunzip take a new max_size (default 1 GiB; unzip checks the declared sizes before inflating anything). xo mod reads a module zip with at most 500 MB in all, and refuses an xo.mod or LICENSE over 16 MB, as Go’s module zip limits.
  • std/time: a Date, ClockTime or Civil may hold any fields (a struct literal, or a JSON body decoded through derive Json). With a year or another field far outside the calendar, Date.weekday, add_days, add_months, days_until and display, and Civil.unix, to_time and format faulted on the native backends on an intermediate overflow, so a server calling one of them on a decoded value could be stopped by one request (the Go backend gave wrong answers instead). Now weekday, display, to_time and format answer for every field, and the others fault only when their answer itself does not fit Int. A server decoding a Date at Int’s ends from a JSON body now answers 200 on every backend, where 0.51.0 answered 500. Found by the std/time security review (decision 0616).
  • std/html: html.unescape_string faulted on Int overflow for a long numeric character reference (�) on the native backends, so unescaping a peer’s text could stop the program or answer 500 in an HTTP handler (0.35.0 to 0.51.0; the Go backend from 0.49.0). It now reads the digits as Go’s rune does, and follows Go’s rule for references of three bytes or fewer: &#x; is U+FFFD and &#9 before another byte stays text, as in Go. Found by the new std/html fuzz harness (decision 0616).

Known limits

Reading a whole response body still holds the decoded body, as Go’s io.ReadAll does, up to the limit the call has. For about 1 MB of hostile gzip that inflates to 1000 MB: ClientStream.read_all (default max_size 1 GiB) peaks at about 1.1 GB, down from 1.7 GB in 0.51.0; Client.send and Client.get decode the body in one step and peak at about 2.1 GB, as in 0.51.0 (their one-shot gunzip now stops at 1 GiB of output, where it had no limit). Go does the same: http.Get then io.ReadAll of that body peaks at 2.1 GB (Go 1.26.11, linux/arm64), and reading it through resp.Body.Read with a 64 KB buffer at 14 MB, where Xo’s ClientStream.read peaks at 23 MB. So whole-body reads are at parity with Go, and streaming is close. If you read responses from servers you do not trust, read a gzip response through Client.open and ClientStream.read, or pass read_all a max_size you can afford. A bound on send’s decoded body, and a Decompressor write that returns at most a given number of bytes as Go’s Read does, are planned for 0.52.

linux/riscv64 (LLVM cross builds, known since 0.51.0, not changed here): a program that uses std’s constant-time crypto (std/crypto, tls, x509, and std/http through TLS) fails to build for linux/riscv64 with clang: error: unsupported argument 'generic' to option '-mcpu=' when the host’s clang config sets -mcpu=generic. The fix is planned for 0.52.

API additions

  • archive.unzip(data, max_size: Int = 1073741824) and archive.gunzip(data, max_size: Int = 1073741824): the new parameter has a default, so existing calls compile unchanged.

0.51.0 (2026-11-13)

Xo 0.51.0 adds format specs to string interpolation ("${n:>6}", "${f:.2f}"), log handlers that send records to files, connections or JSON, an HTTP client with a cookie jar and proxies, and var self methods called through interface values on every backend. It is a security release: it fixes certificate checks that passed when they should have failed, request smuggling, HTTP/2 and other denial of service paths in std/http, a set of denial of service paths in std/json, std/x509, std/tls and std/asn1, and timing side channels in RSA and PKCS #12 (see Security). Interface values are cheaper to build and hold, builds use less memory, and on Windows on ARM (still experimental) a cold build takes about half the time.

Two changes can stop a program that compiled with 0.50.1 from compiling, or change its output: a field whose wire name is - is now left out of JSON, TOML and SQL rows, and protocol errors from std/textproto, std/multipart, std/smtp and the HTTP client quote the line they report (see Breaking changes).

Security

0.51.0 is a security release: upgrade every program built with 0.50.1 or earlier, and rebuild it, since std is compiled into the binary. Unless an item says otherwise, every release through 0.50.1 is affected. Programs built with the Go backend also need Go 1.26.11 or later, which carries Go’s own fixes for the same packages.

Certificate checks that passed when they should have failed (std/x509, std/tls; native backends unless noted):

  • An IPv4-mapped IPv6 address (::ffff:a.b.c.d) in a SAN or an IP name constraint is now a parse error, as in Go 1.27.4: such a SAN matched an IPv4 host while escaping IPv4 excluded ranges.
  • DNS name constraints compare a wildcard SAN case-insensitively, as in Go 1.27.4 (GO-2026-4866, CVE-2026-33810). The Go backend gets this fix only from a Go 1.27 toolchain.
  • Chains through the eight compromised intermediates that Go 1.27.4 distrusts are refused (GO-2026-6809).
  • An RSA key below 1024 bits no longer verifies a certificate or a TLS handshake signature (native and LLVM); keys of 1017 to 1023 bits were accepted.

Inputs that cost far more than their size (denial of service):

  • std/json: seven paths are now linear, including colliding object keys (now hashed with the seeded hash Map uses), nested duplicate keys, the stream decoder and TokenReader fed in small writes, and deep decode errors.
  • std/x509 and std/tls: the policy graph, duplicate extensions, deduplication of intermediates and roots, name constraints (n log n, GO-2025-4007, CVE-2025-58187), host name checks (GO-2025-4155, GO-2026-5037), and chain building, which now stops at 100 signature checks (GO-2026-4946, GO-2026-4947). PEM text is read in linear time (GO-2025-4009, CVE-2025-61723).
  • std/asn1: parsing stops at Go’s 10,000 nesting levels (GO-2026-5972) and no longer copies the input at each level on the WebAssembly and Go backends.
  • std/tls: a peer may send at most 16 records or post-handshake messages in a row that do not advance the connection (empty application data, warning alerts, KeyUpdates, tickets), as Go 1.26.11, on clients and servers.
  • std/archive: untar reads an old GNU sparse map to 1 MiB at most, as Go 1.26.11, and the holes of sparse files add at most 1 GiB per archive, checked before anything is allocated.

Script escaping in templates (std/template html mode, native backends): Go 1.26.11’s html/template fixes (CVE-2026-56858, go.dev/issue/81821 and 81823): a value after {, }, ${, yield, a keyword property or a #private name in a script is escaped for the right context, <script type=""> is JavaScript, and a meta refresh written url = is filtered.

Timing side channels:

  • RSA’s fault check of a private key result, and PKCS #12 MAC verification, compare in constant time.
  • On Arm, secret key operations run with the DIT bit set, as Go 1.24’s crypto does (decision 0619).
  • std’s constant time modules compile at -O2 even in an LLVM -O0 build.

HTTP (std/http, std/multipart, std/textproto; native backends unless noted):

  • Request smuggling and framing: a server closes the connection after a request with both Transfer-Encoding and Content-Length (RFC 9112 6.3); a CONNECT ends HTTP on its connection, as Go 1.26.11 (all backends; GO-2026-6613, GO-2026-6605); a client refuses a Host with CR or LF and writes a User-Agent’s CR and LF as spaces (GO-2023-1878); an HTTP/1.1 server never sends a 100 Continue after the response head (GO-2021-0224).
  • HTTP/2 denial of service: a header field cut across CONTINUATION frames is decoded once and an empty CONTINUATION is not decoded (GO-2023-1571); SETTINGS and connection WINDOW_UPDATE frames no longer walk every open stream (GO-2026-6611); one connection buffers unfinished request bodies of at most four times XO_HTTP_MAX_BODY, refusing the stream past it with REFUSED_STREAM; a client drops a response’s connection specific fields and an invalid Content-Length (all backends; GO-2026-6610).
  • Inputs that cost far more than their size: a slowly sent request head and textproto’s read_header are linear (40,000 fields: 5.8 s to 3 ms; std/mail, std/multipart and std/smtp read headers with it); query parameters stop at 10,000 (all backends; GO-2026-4341); a streamed request’s trailer names are capped at 64 (GO-2026-6603); serve_content ignores a Range of more than 200 ranges (GO-2026-6609); multipart reads a part’s header in linear time within its limit (all backends; GO-2024-2599, GO-2026-6608).
  • ReverseProxy forwards a query that does not parse rebuilt from what parsed, so the upstream sees what the rewrite hook saw (all backends; GO-2022-1038, GO-2026-4976), and answers CONNECT 405.
  • On Windows, a sub Fs denies device names (NUL, COM1, CONIN$, …) and colons under its root, so http.file_server cannot open a device (all backends; GO-2022-1143).

Log forging (std/textproto, std/multipart, std/smtp, std/http client; every backend; GO-2026-5039): protocol errors quote the line they report, as Go 1.26.2 and later do, so a peer’s control bytes and newlines cannot forge log lines (see Breaking changes).

Duration parsing (std/time and every duration reader, native backends): parsing a duration text of 20 or more digits past the range, such as 92233720368547758097ns, is an error as in Go; it wrapped to a small value (17 ns).

Highlights

  • Format specs in interpolation (decision 0617 A): "${x:SPEC}" with [[fill]align][+][0][width][.prec][type]: ${n:>6}, ${n:06}, ${n:x}, ${f:.2f}, ${f:e}, ${s:*^10}. Numbers print as Go’s fmt prints the same verbs, on every backend. A spec the value’s type does not take is the new error XO0180.
  • Log handlers (std/log, decision 0617 C): log.configure_handler(h) sends every record to a Handler built from text_handler or json_handler over a sink (standard error or output, a File, a Conn, or a function), combined with multi and level_range for per level destinations. Handlers see typed field values; log.dropped() counts lines a sink failed to write. The call that installs a handler performs its effects, and xo audit lists each install site.
  • HTTP client cookies and proxies (std/http, decision 0617 B): Client.with_jar(store, clock) keeps cookies across requests and redirects, as Go’s Client.Jar, with cookiejar consulting the new std/publicsuffix. Client.with_proxy(url) and with_proxy_for(f) send requests through an HTTP proxy (https through a CONNECT tunnel, the server’s certificate verified), and the new std/httpproxy reads HTTP_PROXY, HTTPS_PROXY and NO_PROXY as Go’s ProxyFromEnvironment.
  • var self through interface values (decision 0613 step 5): var l: Loader = Box{}; l.load(3) updates the value in its place on every backend (0.50.1 had it on the Go backend only). A copy of the interface value keeps the old value; a million load calls through one value take 2 ms.
  • Cheaper interface values (native, LLVM, wasm): an interface value holds its methods as code addresses beside the value in one heap object, where it held a closure per method: building them is about 18% faster, a million values of an 8 method interface take a third less memory (209.9 to 139.7 MB), and calls cost the same.
  • Borrowed struct projections are back (decision 0612): off in 0.50.1 while a native arm64 crash was found; that crash was the result clobber 0.50.1 fixed.
  • Windows on ARM builds (experimental until 0.52; decisions 0569 and 0388): windows/arm64 builds with the native arm64 backend by default (no --backend=arm64; --targets=all builds all seven targets), and separate compilation is on by default on a windows/arm64 host: a cold build of a program whose std variants are cached takes about half the time (hello 1.6 to 0.8 s, an HTTP service 3.1 to 1.2 s).
  • Build memory (decision 0448): an SSA value is 7 words, was 9; a large cold test build (aiplatform/apiv1, linux/arm64) peaks at about 4.50 GB, was 4.79.

Breaking changes

  • Protocol error text (GO-2026-5039, a security fix): errors from std/textproto, std/multipart, std/smtp and the HTTP client quote the line they report, as Go 1.26.2 and later: malformed MIME header line: ": v", short response: "12 x", and SmtpErr.display() prints 550 "5.1.1 no such user". Migration: a program or test that matches these texts by their old unquoted form compares the quoted one.
  • Fields named - on the wire (decision 0622): a field whose wire string is exactly - (as "-", json "-", sql "-") is now left out of derive Json, Toml and SqlRow, as Go’s json:"-" is and as Cbor, Yaml and Xml already did; it was the JSON key or column -. Migration: write as "-," for the key -. A decoder fills a skipped field with its default, else its type’s zero; a skipped field with neither (a struct or enum type) is the new error XO0440.

Behavior changes

  • Go backend HTTP proxies: an HTTP client no longer goes through the proxy named by HTTP_PROXY or HTTPS_PROXY on its own (Go’s DefaultTransport did), matching the native backends; set one with with_proxy_for(httpproxy.proxy_from_env(os.env)).
  • Go backend interface equality: an interface value converted from another interface, or holding a value with var self methods, equals any interface value holding an equal concrete value, as on the native backends.

Fixes

  • Builds with the front end cache (every backend): a build after another program’s build filled the front end cache no longer fails with XO1201 at std/native/log.xo (Handler.enabled); a replayed function’s interface value type gets its method tables made again. The failure was an error, never wrong code.
  • Crash reports (native, Linux and macOS): when two threads fault at the same moment, the report keeps its frames and traceback; the second fault ended the process while the first was being reported.
  • Time.UNIX_EPOCH defaults (native and LLVM): a std struct whose field defaults to it (std/log’s Record.time) builds without that field; it failed with XO1201.
  • xo test --run='a|b' selects tests whose name contains either text, as Go’s -run alternation reads; the | was taken literally.
  • derive Yaml reads a -, field (the key -) it already wrote.

Known issues

  • macOS: x509 system roots ignore user and admin trust settings, so a root marked Deny is still trusted (GO-2022-0171 class). Fixed in 0.52.
  • std/url: the port of a URL whose scheme is not http or https is read as Go 1.26.1 did, where Go 1.26.11 takes the last colon (Go issue 78077), so such a host and port can split differently from Go. Fixed in 0.52.
  • std/http: the client fails on a URL with an IPv6 zone (http://[fe80::1%25eth0]/), reporting an invalid escape. Fixed in 0.52.
  • --race: memory grows by about 300 bytes per task spawned, as in Go’s -race, plus a one-time trace pool of up to about 1.8 GB on Linux that fills over the first few million tasks. A long-running race build of a busy server grows without bound; use --race for tests and bounded runs.