---
title: "rack-protection 4.0.0 Breaking Changes on RubyGems"
description: "What each rack-protection release removed, renamed or changed: 6 breaking changes in 2 versions on RubyGems, each with its source."
canonical_url: https://since.dev/packages/gem/rack-protection
last_updated: 2026-12-04
---

# rack-protection breaking changes

rack-protection 4.0.0 (January 19, 2024) is its newest release with breaking changes, 4 of them. The first: Drops support for Rack 2, requiring Rack 3 in rack-protection 4.0.0. Every breaking API change we have recorded in rack-protection on RubyGems: 6 breaking changes in 2 versions. Below, its 2 versions with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `4.2.2`. [Source repository](https://github.com/sinatra/sinatra)

Its 4.0.0 release requires Ruby 2.7.8 or later. [Ruby end of life dates](https://since.dev/calendar/ruby.md).

- From [2.0.0](#v-2-0-0) to [4.0.0](#v-4-0-0): 4 breaking changes in 1 version.

## rack-protection 4.0.0 breaking changes

rack-protection 4.0.0, released January 19, 2024: 4 breaking changes.

- **Removed**  

Code that depends on Rack 2 behavior must move to Rack 3. [github.com](https://github.com/sinatra/sinatra/blob/v4.0.0/CHANGELOG.md)
- **Removed** `Rack.Protection.EncryptedCookie`  

Cookies remain encrypted through Rack::Session::Cookie, which code should use instead. [github.com](https://github.com/sinatra/sinatra/blob/v4.0.0/CHANGELOG.md)
- **Behavior changed**  

Users on older Ruby versions must upgrade Ruby before using this release. [github.com](https://github.com/sinatra/sinatra/blob/v4.0.0/CHANGELOG.md)
- **Default changed** `session_hijacking`  

Users who relied on the default must enable session_hijacking protection explicitly. [github.com](https://github.com/sinatra/sinatra/blob/v4.0.0/CHANGELOG.md)

## rack-protection 2.0.0 breaking changes

rack-protection 2.0.0, released May 7, 2017: 2 breaking changes.

- **Behavior changed**  

Route patterns are now parsed by Mustermann, so existing route patterns may match differently and should be tested. [github.com](https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md)
- **Behavior changed**  

The not_found and error handlers now share 404 behavior, so apps that relied on the old separate handling must check their 404 responses. [github.com](https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md)

## Related packages

- [sinatra](https://since.dev/packages/gem/sinatra.md)
- [sinatra-contrib](https://since.dev/packages/gem/sinatra-contrib.md)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#api) reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

## Put your code on continuous maintenance.

Scan a public repository now, or give your agent one line.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
