Skip to content

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

Docker 5 min read Case study mediumAdept

Your Dependencies Don’t Care About Your FIPS Configuration

FIPS-enabled container images can still run non-FIPS crypto because prebuilt native dependencies bring their own crypto linkage. A Rails app on a correctly configured Ruby/OpenSSL 3 FIPS image hit crypto errors only through ActiveRecord, traced to a prebuilt libpq pulled in by the pg gem. The fix is to set force_ruby_platform: true for pg (or BUNDLE_FORCE_RUBY_PLATFORM) and install libpq-dev so the gem is compiled against the image's OpenSSL. Enabling this globally drags in compilers and headers for every native gem, so the recommendations are to treat prebuilt binaries as suspect, verify linkage with ldd, compile selectively in a multi-stage build, and test real execution paths such as running queries.

Related posts

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

    Sourcegraph mediumAdept

    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.

  • Finding Relationships Between Ruby’s Top 100 Packages and Their Dependencies

    Shopify Engineering mediumAdept

    RubyGems' MFA requirement for gems over 180M downloads leaves a loophole: some big gems depend on small gems below the threshold, so compromising a small gem's owner account reaches big gems' users. Querying rubygems.org data dumps found 112 big gems; the rubygems.org API showed 13 with small direct dependencies, and resolving full transitive trees via programmatic `bundle lock` raised that to 24. Small dependencies exist mainly because they are newer than their parents or ship with Ruby by default (e.g. racc, rexml). A dependency graph built with the graph gem and a custom DFS that enumerates all paths show how each big gem reaches each small one, and the proposed responses are waiting for universal MFA or enforcing MFA early on those specific gems.

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

  • How GitHub uses CodeQL to secure GitHub

    GitHub Engineering mediumAdept

    GitHub's Product Security Engineering team runs CodeQL across more than 10,000 repositories, mostly with default setup and the security-extended suites. Its Ruby monolith gets advanced setup with a custom query pack published to GitHub Container Registry. Publishing the pack separately avoided production deploys for every query change, gave precompiled queries, and kept CodeQL CLI upgrades from breaking monolith CI. A bad query could be rolled back by republishing the pack in under 15 minutes. The post shows how they pin the ruby-all dependency via codeql-pack.lock.yml, unit-test queries, share the pack through a linked repository, and use recommendation-severity custom queries (e.g. missing control_access on REST endpoints, ActiveRecord decrypt) alongside multi-repository variant analysis for bug bounty follow-up.

  • MITM attacks are easier to avoid with psql (Postgres) 16

    Neon mediumAdept

    Postgres 16's psql adds `sslrootcert=system`, which uses the OS's trusted CA store and implies `sslmode=verify-full`. Together with the new `require_auth` option, it closes a MITM hole that `sslmode=require` leaves open. `require` encrypts the connection but never checks the server certificate. An attacker who spoofs DNS can then request a cleartext password, and libpq will hand it over even if the real server uses SCRAM-SHA-256. A proof-of-concept Ruby proxy under 100 lines, combined with bettercap DNS spoofing, captured credentials and proxied the session in a few hours. The recommendation is to connect with `sslrootcert=system` (or `verify-full` plus a CA bundle on older psql) and set `PGSSLROOTCERT`, `PGSSLMODE` and `PGREQUIREAUTH=scram-sha-256` as environment defaults.

The quest for software engineering knowledge.

Look:
Layout: