A Packwerk Retrospective
Packwerk, Shopify's static analysis gem for enforcing package boundaries in Rails monoliths via constant references, works best as a dependency-graph tool rather than an API-privacy tool, which is why privacy checks were removed in 3.0. Its blind spots are significant: it relies on developer-drawn package graphs that often follow naming semantics rather than runtime behaviour, it gives no guidance on fixing violations, and it ignores constants loaded outside Zeitwerk as well as routes, initializers and fixtures. Isolating a zero-dependency 'Platform Essentials' package took months. Reaching zero violations was not enough, and real isolation also needed booting the package alone and running its tests in CI. Domain-based package boundaries fit poorly with how code actually runs, while function-based layering proved more workable.
Related posts
- How We Fixed the Dependency Confusion Vulnerability in Over 600 Ruby Applications
Shopify Engineering mediumAdeptShopify 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.
- Dependency prefixes are a supply chain risk: let's fix them
Sourcegraph mediumAdept
SemVer range prefixes like ^, ~ and wildcards in package.json act as a trust policy that lets compromised or hijacked packages flow into CI and production on the next install. The recommended controls are to commit lockfiles and install with npm ci, pnpm --frozen-lockfile or yarn --immutable, pin exact versions for high-blast-radius packages such as build tools, auth libraries and native-binding deps, set save-exact defaults, disable install scripts with an allowlist for exceptions, and run audits against the locked tree. To roll this out across hundreds of repositories, a Sourcegraph Batch Changes spec with a Node script rewrites React dependency ranges to approved exact versions and refreshes lockfiles without running scripts.
- 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.
- Making Open Source Safer for Everyone with Shopify’s Bug Bounty Program
Shopify Engineering mediumAdeptA 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.
- Package managers have an integrity problem
Trail of Bits mediumAdeptAn experiment across 25 popular package managers tested whether each detects a compromised repository injecting malicious code into legitimate packages. Fewer than half verify lockfile hashes by default, only Go and vcpkg verify every download, and only Go checks signatures by default. The tests used a Docker and mitmproxy harness that simulated a malicious server. Several failures are documented design choices rather than bugs: Pub and older pnpm overwrite mismatched hashes, Conan and CocoaPods use MD5 or SHA-1 identifiers that are never rechecked, Composer trusts GitHub-served ZIPs, and cpanminus still uses plain HTTP. Lockfiles serve many purposes besides integrity, which helps explain the gaps.