Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Crystal Blog 3 min read Incident mediumAdept

Post Mortem: HTTP Request Smuggling Vulnerability

Crystal's HTTP::Server request parser preferred Content-Length over Transfer-Encoding because an elsif chain never evaluated the chunked branch when Content-Length was present. That enabled CL.TE request smuggling when a TE-preferring reverse proxy sits in front, potentially bypassing proxy-enforced auth or rate limits. The fix follows RFC 9112 Section 6.1: requests carrying both headers are rejected and Transfer-Encoding is checked first. It shipped in Crystal 1.20.0 and 1.19.2. The team rated the risk low because exploitation needs a non-compliant proxy.

Assumes: HTTP/1.1 message framingreverse proxies

Related posts

  • Crystal 1.22.3 is released!

    Crystal Blog mediumAdept

    Crystal 1.22.3 is a patch release of 14 changes from 4 contributors, focused on security fixes and regressions. Sockets now reject port numbers above 65535 instead of silently truncating them, for example binding 73616 as 8080. The HTTP parser now rejects invalid headers, chunk lines and Content-Length values that could cause request desync, and a `close` token in the Connection header always closes the connection. The release also fixes `IO::Delimited` matching after a fragmented delimiter and an `Enum.parse?` regression from 1.22.0 that could cause out-of-bounds writes.

  • How to avoid bad assumptions during incidents

    incident.io mediumAdept

    HTTP header names arriving downcased at a public API were wrongly blamed on a Google Cloud Load Balancer change. The real cause was an HAProxy upgrade that lowercases HTTP/1 header names. The verification step was confounded because curl had silently negotiated HTTP/2, which mandates lowercase header names, so the test appeared to confirm the load balancer theory. The lessons: log every command and result during an incident, re-check earlier conclusions whenever severity rises, and distrust a compelling story that matches your biases.

  • Crystal 1.20.3 is released!

    Crystal Blog easyNovice

    Crystal 1.20.3 fixes two security vulnerabilities in the YAML parsers. Recursive parsing had no limit on nesting depth, so deeply nested documents could overflow the stack; `YAML::PullParser` now has a `max_nesting` option. Alias expansion was open to the billion laughs attack, where a 100-node document could expand to over a billion nodes; an alias-to-anchor ratio check now blocks this. Applications that parse YAML from untrusted sources should upgrade promptly.

  • How Cloudflare WAF protects against ruby2shell (CVE-2026-132825)

    Cloudflare mediumAdept

    ruby2shell (CVE-2026-132825) is a heap buffer overflow in Ruby's string case conversion: in 14 legacy single-byte encodings, uppercasing the German ß writes two bytes (SS) but reserves room for one, so 21 sharp s characters overflow by a byte, with proofs of concept reaching remote code execution. Default Rails and classic Sinatra apps are exposed before authentication because Rack's MethodOverride middleware upcases the `_method` parameter, which an attacker can send in a legacy charset via a multipart POST. Cloudflare added Block-by-default managed rules for this CVE and the related integer overflow GHSA-87fm-7w84-j2px on all plans, and suggests attack-score custom rules as extra defense. It stresses that the WAF cannot see direct-to-origin, internal or non-HTTP paths, so upgrading to Ruby 3.3.14, 3.4.13 or 4.0.10 and restarting all processes is the real fix.

  • Protecting user data through source code analysis at scale

    Meta Engineering mediumAdept

    Meta's Anti-Scraping team encodes known scraping attack vectors as taint-analysis rules in its in-house static analyzers, Zoncolan for Hack and Pysa for Python, so potential vectors are flagged before code ships. Rules define sources (user-controlled parameters such as a result count or target ID) and sinks (data returned to the user), and a possible flow between them is raised as an issue for triage. In a mock followers endpoint, an uncapped count lets scrapers pull entire follower lists in one request and slip past rate limiting. The fix clamps count to a maximum, forcing scrapers into many more requests that rate limits then catch. Static analysis cannot catch scrapers that mimic legitimate usage, so it is one part of a broader defense.

The quest for software engineering knowledge.

Look:
Layout: