---
title: "Making Open Source Safer for Everyone with Shopify’s Bug Bounty Program"
description: "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."
url: "https://swe.quest/articles/making-open-source-safer-for-everyone-with-shopify-s-bug-bounty-program-48c56c4f3d09ee13"
canonical: "https://shopify.engineering/shopify-making-open-source-safer"
source: "Shopify Engineering"
published: "2022-06-15"
difficulty: "medium"
kind: "Case study"
reading_minutes: 5
tags: ["appsec","ruby","open-source"]
---

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

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2022-06-15, 5 min read, Case study. Original: [https://shopify.engineering/shopify-making-open-source-safer](https://shopify.engineering/shopify-making-open-source-safer)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Application security](https://swe.quest/tags/appsec.md) (Security)
- [Ruby](https://swe.quest/tags/ruby.md) (Languages)
- [Open source](https://swe.quest/tags/open-source.md) (Engineering practices)

## Prerequisites

- Ruby on Rails basics ([easy posts on Ruby](https://swe.quest/tags/ruby.md?difficulty=easy))
- insecure deserialization

## Keywords

Rails, ActiveSupport, MessageEncryptor, MessageVerifier, Marshal, Shopify

## Related posts

- [The Case Against Monkey Patching, From a Rails Core Team Member](https://swe.quest/articles/the-case-against-monkey-patching-from-a-rails-core-team-member-b0bd43ce3a761b2b.md): Shopify Engineering · 2023-02-21 · Medium · 14 min read · Ruby, Refactoring & migrations, Open source
  Monkey patching Rails and other gems is brittle and should be avoided.
- [Caching Without Marshal Part 2: The Path to MessagePack](https://swe.quest/articles/caching-without-marshal-part-2-the-path-to-messagepack-dde2d14188f0b673.md): Shopify Engineering · 2022-11-15 · Medium · 17 min read · Ruby, Caching, Refactoring & migrations
  Shopify replaced Ruby's Marshal with MessagePack as the Rails cache format for its core monolith so that code changes would stop breaking cached payloads on deploy.
- [Ruby2Shell (CVE-2026-132825): find vulnerable Ruby across your repos](https://swe.quest/articles/ruby2shell-cve-2026-132825-find-vulnerable-ruby-across-your-repos-943808a4d97a4f48.md): Sourcegraph · 2026-11-20 · Medium · 5 min read · Ruby, Vulnerability research, Supply chain security, Developer tools
  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.
- [How We Fixed the Dependency Confusion Vulnerability in Over 600 Ruby Applications](https://swe.quest/articles/how-we-fixed-the-dependency-confusion-vulnerability-in-over-600-ruby-14f9a0a0836510b2.md): Shopify Engineering · 2022-01-27 · Medium · 9 min read · Supply chain security, Ruby, Refactoring & migrations, CI/CD
  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.
- [How GitHub converts previously encrypted and unencrypted columns to ActiveRecord encrypted columns](https://swe.quest/articles/how-github-converts-previously-encrypted-and-unencrypted-columns-to-7a6a32eb2ff23c82.md): GitHub Engineering · 2022-11-03 · Medium · 7 min read · Ruby, Cryptography, Schema migrations, Security, Deployment
  GitHub migrated plaintext columns and columns encrypted with a deprecated internal library to ActiveRecord::Encryption.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
