Same-Origin Policy
同一生成元ポリシー
同一生成元ポリシーはブラウザの安全規則です。これは、ある生成元からのページやスクリプトが別の生成元のデータを読み取ったり操作したりする方法を制限します。
もう一つの例
`reports.example` のスクリプトは、`mail.example` のユーザーの受信箱を読み取ることができません。ブラウザはそこにクッキーを送信できます。予定されているクロスオリジンのAnalytics APIは、正確に1つの `Access-Control-Allow-Origin` を返し、認証情報は返しません。ウィンドウメッセージは、`event.origin` とメッセージの形式を確認した後にのみ受け入れられます。
主な部分
- 01ソース起源
- 02ターゲットの起源とリソース
- 03読み取り/操作制限または明示的な許可
以下の場合に使用します
各オリジンを基本的なブラウザの安全境界として扱ってください。共有が必要な場合は、最小限の権限で明確なCORSまたは`postMessage`アクセスを作成します。
以下の場合は使用しないでください
SOPはすべてのクロスサイト要求、ナビゲーション、埋め込み、CSRF、またはサイドチャネルを停止するわけではない。主な役割は読み取りと操作を制限することである。
コードで使用する名前
origin tuple (scheme, host, port) + controlled CORS/postMessage exceptions 出荷前に
Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback.
Outcome:Complete the task with 同一生成元ポリシー (Same-Origin Policy)。 User context:`reports.example` のスクリプトは、`mail.example` のユーザーの受信箱を読み取ることができません。ブラウザはそこにクッキーを送信できます。予定されているクロスオリジンのAnalytics APIは、正確に1つの `Access-Control-Allow-Origin` を返し、認証情報は返しません。ウィンドウメッセージは、`event.origin` とメッセージの形式を確認した後にのみ受け入れられます。 Technical concept or control:同一生成元ポリシー (Same-Origin Policy)。 Why it fits:各オリジンを基本的なブラウザの安全境界として扱ってください。共有が必要な場合は、最小限の権限で明確なCORSまたは`postMessage`アクセスを作成します。 Do not use it when:SOPはすべてのクロスサイト要求、ナビゲーション、埋め込み、CSRF、またはサイドチャネルを停止するわけではない。主な役割は読み取りと操作を制限することである。 Engineering requirements: Define inputs, outputs, contracts, and rules that must always hold. Set authorization and input checks. Define failures, timeouts, retries, one-time effects, data moves, and compatibility limits. Operations: Add useful signals and logs that hide sensitive data. Set capacity limits and write an operator guide. Test recovery and rollback. Acceptance criteria: Contract and failure-path tests pass. Data and authorization rules still hold during retries and partial failures. Check performance limits, monitoring, recovery, and rollback. Evidence and limits (evidence boundary):この標準は、列挙された範囲のみを対象とします。視覚スタイル、製品の判断、またはVibularyの例は選びません。 Unknowns to confirm: Where the code runs, data stores, traffic shape, consistency needs, and the security boundary. Also confirm the compatibility period, service goals, and rollback limits.
このリクエストを確認する
Review how 同一生成元ポリシー (Same-Origin Policy) is used now. Definition: 同一生成元ポリシーはブラウザの安全規則です。これは、ある生成元からのページやスクリプトが別の生成元のデータを読み取ったり操作したりする方法を制限します。 Release checks: Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.