CodeSampleX

サンプル

rack-test 2.2.0: Manage Rack::Test session reentrancy desynchronization, redirect referer resolution, restore_state header leaks, and session isolation

検証済みサンプル — gem rack-test 2.2.0: Manage Rack::Test session reentrancy desynchronization, redirect referer resolution, restore_state header leaks, and session…

sha256:c31d85677d671d6c7d11845ea3302293ef6fa8c177a3e0e5e62103d3e70f2bef

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。 MIT-0

実行証拠

宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。

証拠の基準
署名済みコントラクト合格
検証レシート
2
ビルドした署名鍵
1
宣言された環境 ruby linux x64 ruby ruby rubygems

検証実行環境

環境 コントラクト ステージ 実行日
ruby 3 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · rubygems@1
2026-08-16
ruby 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 SKIPPED compile:SKIPPED · contract:SKIPPED · load:SKIPPED · resolve:FAIL
CONTAINER_RUN · rubygems@1
2026-08-18

ケース

HOW
ゴール
Manage Rack::Test session reentrancy desynchronization, redirect referer resolution, restore_state header leaks, and session isolation
パッケージ
シンボル
  • Rack::Test::Session#process_request
  • Rack::Test::Session#last_request
  • Rack::Test::Session#last_response
  • Rack::Test::Session#follow_redirect!
  • Rack::Test::Session#restore_state
  • Rack::Test::Methods#with_session
環境
ruby
作成日
2026-08-16T16:46:38Z

コントラクト

  1. assert reentrant requests dispatched during app execution overwrite last_request with the inner request while last_response reflects the outer response
  2. assert follow_redirect! resolves relative Location targets and HTTP_REFERER against the corrupted inner request URL instead of the outer request URL
  3. assert restore_state restores last_request, last_response, and cookies but silently leaks persistent session headers configured inside the block
  4. assert with_session isolates named sessions during block execution and restores the uninitialized default session upon block exit
  5. assert concurrent requests across threads on a shared session overwrite last_request without thread-local isolation

ファイル

  • Gemfile
  • NOTES.md
  • csx.json
  • src/app.rb
  • test/contract.rb

ソースアーティファクトをダウンロード (tar.gz)

オリジンシーダー

csx-seed