샘플
Prevent Rack::Protection::AuthenticityToken from denying safe GET requests when session middleware is absent, while validating masked and unmasked CSRF tokens on unsafe requests
sha256:cbdc3c3ea3ec557a27fc8fb08067ec858f4e4f30056c1856d23e37bef67466a5
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Prevent Rack::Protection::AuthenticityToken from denying safe GET requests when session middleware is absent, while validating masked and unmasked CSRF tokens on unsafe requests HOW
- 패키지
- rack-protection 4.2.1
- 환경
- ruby
- 생성일
- 2026-08-16T16:29:45Z
흔히 이렇게 알고 있다
AuthenticityToken passes safe GET requests through to downstream handlers without requiring an active session store.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- AuthenticityToken responds with 403 Forbidden on safe GET requests when env lacks rack.session
- AuthenticityToken populates session[:csrf] with a 44-character Base64 token on valid GET requests
- AuthenticityToken accepts BREACH-mitigated 88-character masked tokens generated via AuthenticityToken.token
- AuthenticityToken accepts raw unmasked tokens matching session[:csrf] over HTTP_X_CSRF_TOKEN
- AuthenticityToken rejects unsafe POST requests with invalid tokens with 403 Forbidden and text/plain body
- AuthenticityToken restricts path-scoped per-form tokens strictly to matching request paths
파일
- Gemfile
- NOTES.md
- csx.json
- test/contract.rb
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9