Case Studies

Stripe's Dependency Security Practices

How Stripe secures its software dependencies while processing billions of dollars in payments, with a focus on Ruby ecosystem hardening and dependency isolation.

Yukti Singhal
Security Researcher
7 min read

Stripe processes hundreds of billions of dollars in payments annually. A supply chain compromise in Stripe's infrastructure could result in stolen payment credentials, manipulated transactions, or disrupted commerce for millions of businesses. The stakes make Stripe's approach to dependency security worth examining closely.

What distinguishes Stripe's situation from most organizations is the regulatory environment. PCI DSS compliance imposes specific requirements on how software components are managed, tracked, and updated. This creates a baseline of discipline that many organizations don't have, and that discipline extends to supply chain security practices that go well beyond compliance minimums.

The Payment Stack Challenge

Payment processing demands both speed and correctness. Transactions must be processed in milliseconds. A single incorrect decimal point can mean millions of dollars moving to the wrong account. These requirements shape how Stripe thinks about dependencies.

Every dependency in the payment path is a potential point of failure or compromise. A serialization library that behaves differently under edge cases could corrupt transaction data. A networking library with a vulnerability could expose card numbers in transit. A logging library that inadvertently captures sensitive fields could create compliance violations.

Stripe's approach is conservative by design. The payment-critical path uses fewer dependencies than most applications of comparable complexity. Where possible, Stripe builds internal implementations of critical functionality rather than depending on third-party libraries. The build-versus-buy decision is weighted heavily toward build when the component touches payment data.

This isn't practical for every organization, and Stripe doesn't apply it universally. Non-payment-critical systems use third-party libraries freely. But for the core payment path, minimizing the dependency surface is a deliberate security strategy.

Dependency Isolation

Stripe employs strong isolation between components with different trust levels. Dependencies that handle untrusted input are sandboxed. Services that process payment data are isolated from services that handle non-sensitive operations.

This isolation operates at multiple levels:

Process isolation. Components that parse untrusted data (webhooks, API requests) run in separate processes from components that access payment credentials.

Network isolation. The network architecture limits which services can communicate with each other. A compromise of a peripheral service can't reach payment infrastructure through the network.

Dependency isolation. Different services can use different versions of the same dependency. This prevents a vulnerability in one service's dependency from automatically affecting another service, even if they use the same library.

Data isolation. Payment credentials are accessible only to a small set of services. Even if a dependency vulnerability allows code execution, the compromised service might not have access to sensitive data.

This defense-in-depth approach means that a supply chain compromise has to defeat multiple layers of isolation before reaching payment data. No single dependency vulnerability provides a path from the internet to cardholder information.

Ruby and Beyond

Like Shopify, Stripe has significant Ruby infrastructure, and they've invested heavily in the Ruby ecosystem's security. Stripe's Ruby library is one of the most widely used payment SDKs, so they have a dual interest in Ruby security: as both consumer and producer.

Stripe's contributions to Ruby ecosystem security include:

Sorbet type checker. Stripe developed Sorbet, a gradual type checker for Ruby. While primarily a developer productivity tool, static typing catches categories of bugs that could have security implications: type confusion, unexpected nil values, and interface violations.

Dependency analysis tooling. Internal tools that analyze the full dependency tree of Ruby applications, including transitive dependencies, and flag potential issues.

Gem security advisories. Active participation in the Ruby advisory database, contributing vulnerability information for gems they've analyzed.

Beyond Ruby, Stripe also maintains significant Java, Go, and Python codebases, each with its own dependency management practices adapted to the ecosystem's tooling and conventions.

Automated Dependency Governance

Stripe automates dependency governance with a system that evaluates new dependencies before they're introduced and continuously monitors existing ones.

For new dependencies, the evaluation includes:

Security posture assessment. Has the library had previous vulnerabilities? How quickly were they addressed? Is the maintainer responsive to security reports?

Maintenance health. Is the project actively maintained? How many contributors does it have? Is there a bus factor risk?

License compatibility. Does the license conflict with Stripe's requirements or create obligations they can't fulfill?

Alternatives analysis. Are there better-maintained or more secure alternatives that provide the same functionality?

For existing dependencies, continuous monitoring includes:

Version tracking. How far behind is the deployed version from the latest release? Falling behind accumulates security debt.

Vulnerability correlation. Newly disclosed vulnerabilities are automatically correlated with deployed dependencies. Affected services are identified and owners notified.

Usage analysis. Which functions from a dependency are actually used? If only a small portion of a large library is used, the unused portions represent unnecessary attack surface.

PCI DSS and Supply Chain Requirements

PCI DSS imposes specific requirements that directly affect supply chain security:

Requirement 6: Develop and maintain secure systems and applications. This includes maintaining an inventory of software components and monitoring for vulnerabilities.

Requirement 11: Regularly test security systems and processes. This includes vulnerability scanning of the software supply chain.

Requirement 12: Maintain a security policy that addresses information security for all personnel. This extends to contractors and vendors.

Stripe goes beyond PCI minimums because compliance and security aren't the same thing. PCI DSS sets a floor, not a ceiling. The compliance requirements provide a useful framework, but they don't address all supply chain risks.

For example, PCI DSS doesn't specifically require SBOM generation, build provenance tracking, or dependency health scoring. Stripe implements these because they reduce risk, not because an auditor requires them.

Incident Response for Dependency Vulnerabilities

Stripe's incident response process for dependency vulnerabilities is structured around the payment calendar. Black Friday, Cyber Monday, and month-end processing periods are high-stakes windows where deployment risk is elevated.

The process includes:

Severity classification that considers business context. A critical vulnerability in a library used by the checkout flow during the holiday season gets different treatment than the same vulnerability in an internal analytics tool in January.

Pre-approved emergency changes. For critical vulnerabilities, pre-approved change procedures allow rapid deployment without full change management overhead. These procedures are defined in advance, not improvised during the incident.

Rollback readiness. Every security patch deployment is prepared with a rollback plan. If the patch introduces instability, reverting to the vulnerable version is preferred over extended downtime, with compensating controls applied until a stable patch is available.

Communication protocols. When a supply chain vulnerability affects Stripe's customers (for example, a vulnerability in a Stripe SDK), communication plans are pre-defined with templates, timelines, and escalation paths.

What Makes Payment Security Different

Payment infrastructure imposes constraints that other organizations can learn from even if they don't process payments:

Conservative dependency adoption. Adding a dependency to the payment path is a significant decision that involves security review, not just a developer adding a line to a Gemfile.

Defense in depth through isolation. No single compromise should provide access to the most sensitive data. This principle applies beyond payments.

Compliance as a foundation, not a ceiling. Regulatory requirements provide structure, but security goes beyond compliance.

Business context in vulnerability management. Not all vulnerabilities are equally urgent. Business context, including seasonality, customer impact, and data sensitivity, should drive prioritization.

How Safeguard.sh Helps

Safeguard.sh provides the dependency governance, vulnerability monitoring, and SBOM management that payment and other regulated organizations need. The platform tracks every dependency across your services, maps the blast radius of vulnerabilities to specific business-critical paths, and maintains the continuous inventory that PCI DSS and other compliance frameworks require. For organizations where a supply chain compromise means financial loss, regulatory penalty, or customer harm, Safeguard.sh delivers the visibility and alerting that makes proactive dependency security practical.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.