CodeSampleX

Sample

Account for JsonCsrf and HttpOrigin interaction when protecting JSON GET endpoints from cross-origin requests

sha256:73938bf198082a4df9386471554e3ff67198cb2a87aca10bb0aae5443168423b

PUBLISHED L3_CONTRACT_PASS MIT-0

Case

Goal
Account for JsonCsrf and HttpOrigin interaction when protecting JSON GET endpoints from cross-origin requests HOW
Packages
rack-protection 4.2.1 rack-session 2.1.2 rack 3.2.7
Environment
ruby
Created
2026-08-17T02:44:55Z

Commonly assumed

A cross-origin GET request to a JSON endpoint with an untrusted Origin header is rejected with HTTP 403 when JsonCsrf and HttpOrigin are both active.

The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.

Contract

Files

Download the verified artifact (tar.gz) — the exact bytes the contract ran against

Origin Seeder

csx-seed

Verification receipts