Skip to content

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

Sourcegraph 5 min read How-to mediumAdept

Ruby2Shell (CVE-2026-132825): find vulnerable Ruby across your repos

Ruby2Shell (CVE-2026-132825) is a critical heap overflow in Ruby's string case conversion that researchers say default Rails and classic Sinatra apps expose without authentication, with remote code execution proofs of concept known. Fixed releases are 3.3.14, 3.4.13 and 4.0.10, and the hard part is finding which interpreter actually runs, because Dockerfiles, .ruby-version, Gemfile and Gemfile.lock can disagree and vendor products may bundle their own Ruby. Sourcegraph gives regex Code Search queries for affected version pins, a Deep Search prompt to reconcile pins per repo, and an Agentic Batch Changes prompt to bump exact pins within each series. Floating tags, unresolved build args and Ruby 3.2 or earlier are flagged for rebuild, review or migration rather than edited automatically.

Assumes: Ruby version managementDockerfile multi-stage buildsregular expressions

Related posts

  • 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.

  • How We Fixed the Dependency Confusion Vulnerability in Over 600 Ruby Applications

    Shopify Engineering mediumAdept

    Shopify closed a dependency confusion hole across roughly 600 Ruby applications by migrating each `Gemfile.lock` to Bundler's newer format, which pins every gem to an explicit source. A custom Bundler plugin did the upgrade without changing dependency versions: it allowed only patch updates during regeneration, then restored the original versions. A CLI running on top of CI gave each repository its own environment, ran the migrations in parallel and opened pull requests automatically. Shopify also failed CI on outdated Bundler versions and worked with the Bundler maintainers on changes that shipped in 2.2.21 and 2.2.22, the latter preventing lockfiles from regressing to the old format.

  • Making Open Source Safer for Everyone with Shopify’s Bug Bounty Program

    Shopify Engineering mediumAdept

    A Shopify bug bounty report showed that a leaked Rails development secret could be escalated to remote code execution because ActiveSupport's MessageEncryptor deserialized data with Marshal by default. Shopify patched its app to use JSON serialization, then contributed Rails changes making JSON the default serializer for MessageEncryptor and MessageVerifier starting in 7.1, with an upgrade path for existing apps. It also shares a patch that hooks Marshal.load and Marshal.dump in development and CI to flag unexpected calls from gems, tracking and deprecating Marshal use across an application.

  • php2shell: patching PHP is easy, finding it is the hard part

    Sourcegraph mediumAdept

    PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 fix two unauthenticated RCE memory-safety bugs (CVE-2026-109618/109619, dubbed php2shell) in the request lifecycle, reachable on mod_php via a crafted multipart POST before application code runs. PHP 8.1 and older get no fix. The hard part is inventorying every PHP runtime across Dockerfiles, OS package installs, Helm charts, CI workflows and Composer pins, and concrete regex searches are given for each. Remediation order: patch internet-facing mod_php first, restart workers, rotate credentials the web user can read, preserve forensics, rebuild images, and isolate EOL hosts. The rest is a pitch for Sourcegraph Deep Search and Agentic Batch Changes to automate the inventory and version bumps.

  • Docker patches Java4Shell and the NGINX HTTP/2 with Docker Hardened Images

    Docker mediumAdept

    Java4Shell (CVE-2026-114938) is a HotSpot memory-corruption bug in the AVX-512 VBMI Base64 decoding intrinsic that writes up to 62 bytes past a heap buffer, enabling heap disclosure and pre-auth RCE in apps like Keycloak and Jenkins on Java 17.0.6+ running on affected x86-64 CPUs. Exposure requires a vulnerable Java version, an AVX-512 VBMI host, and attacker-controlled Base64 input. The guidance covers checking CPU flags and runtime versions in shell-less images, tracking which vendor builds are fixed, and applying -XX:-UseBASE64Intrinsics as a stopgap. That flag must be set via JAVA_TOOL_OPTIONS or JDK_JAVA_OPTIONS, not JAVA_OPTS, with care around FIPS images, Java 8 and child JVMs, then verified on the running process; NGINX HTTP/2 fixes ship in 1.30.7 and 1.31.9.

The quest for software engineering knowledge.

Look:
Layout: