バックエンド、データ、セキュリティ さらに詳細 A1 · 公式標準 プラットフォーム: ウェブ

CORS

クロスオリジンリソース共有

CORSはブラウザのHTTP安全ルールです。サーバーはどの他のオリジンが応答を読むことができるかをリストします。メソッド、ヘッダー、資格情報を制限することができます。

仕組みを見る
そう呼ぶかもしれません CORSクロスオリジンポリシーフライト前確認(プレフライト)

仕組みを見る

元の作業例クロスオリジンリソース共有

もう一つの例

app.example.comのダッシュボードは、api.example.netを呼び出します。APIは、ログインが必要な書き込みの前にpreflightをチェックし、本番環境のoriginだけを許可します。

主な部分

  1. 01Identity or input
  2. 02Policy or transformation
  3. 03Stored result and audit evidence

以下の場合に使用します

ブラウザコードが他のオリジンを読む必要がある場合は、サーバーまたはゲートウェイでCORSを設定します。

以下の場合は使用しないでください

資格情報付きのワイルドカードオリジンを使用したり、未知のオリジンを反映したりしないでください。CORS は認証や CSRF 保護の代わりにはなりません。

コードで使用する名前

Origin / Access-Control-Allow-* / OPTIONS

出荷前に

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 クロスオリジンリソース共有 (CORS)。 User context:app.example.comのダッシュボードは、api.example.netを呼び出します。APIは、ログインが必要な書き込みの前にpreflightをチェックし、本番環境のoriginだけを許可します。 Technical concept or control:クロスオリジンリソース共有 (CORS)。 Why it fits:ブラウザコードが他のオリジンを読む必要がある場合は、サーバーまたはゲートウェイでCORSを設定します。 Do not use it when:資格情報付きのワイルドカードオリジンを使用したり、未知のオリジンを反映したりしないでください。CORS は認証や 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 クロスオリジンリソース共有 (CORS) is used now. Definition: CORSはブラウザのHTTP安全ルールです。サーバーはどの他のオリジンが応答を読むことができるかをリストします。メソッド、ヘッダー、資格情報を制限することができます。 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.

A1
この用語はどれくらい公式か?

公式標準

名前のついた基準が、このページで説明されているルールを決めているよ。

この標準は、列挙された範囲のみを対象とします。視覚スタイル、製品の判断、またはVibularyの例は選びません。

範囲
ソースがカバーするもののみ:正式名、定義、セマンティクス、実装
ドキュメントステータス
生活基準
チェックオン
2026-07-30

証拠の情報源と範囲

権威のある情報源 + 用語参照 · WHATWG · 生活基準 Fetch Standard — CORS protocol CORS protocol 範囲: 正式名、定義、セマンティクス、実装 ここでの役割: 直接用語参照 ソースの範囲: 正式名, 定義, セマンティクス, 実装 権威のある情報源 · WHATWG · 生活基準 Fetch Standard 範囲: 正式名、定義、セマンティクス、実装 ここでの役割: 指定された範囲内の権威 ソースの範囲: 正式名, 定義, セマンティクス, 実装

自分でコピーする

ブラウザはこれをコピーできませんでした。下のリクエストを選択して自分でコピーしてください。