-
Notifications
You must be signed in to change notification settings - Fork 4
/
569.txt
421 lines (337 loc) · 27.4 KB
/
569.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
[4]
[DFN[[RUBYB[同一起源ポリシー]@en[same origin policy]]]]は、
[[Web]] において、[[スクリプト]]が異なる[[起源]] [WEAK[([[URL scheme]]、[[ホスト]]、[[ポート]]の組など)]]
に由来する[[物体]]に対してアクセスすることを制限する[[セキュリティー]]に関する大原則です。
;; [55] たまに [DFN[[[SOP]]]] と略されることがあります。
* 仕様書
[REFS[
- [3] '''[CITE@en-US-x-hixie[HTML 5]] ([TIME[2008-07-04 05:49:35 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#origin>'''
]REFS]
* 同一起源ポリシーの原理
[56] [[Webアプリケーション]]は、[[鯖]]が提供した[[スクリプト]]等を [[Webブラウザー]]上の環境において実行、
評価するものですが、適切な[[セキュリティー・モデル]]が無ければ[[利用者]]やその他の人が意図しない有害な動作がなされてしまうかもしれません。
[[同一起源方針]]は [[Webブラウザー]]上で動作する[[Webアプリケーション]]のための[[セキュリティー・モデル]]として発展、収束してきたものです。
[[RFC 6454]] で [[Adam Barth]] は次の基本原理をまとめています。
[FIG(short list)[
- Trust
- Origin
- Authority
- Policy
]FIG]
** Trust
[57] [[同一起源方針]]においては [[URL]] によって [[trust]] を指定していると言えます。
[EG[
[58] 例えば [CODE(HTMLe)@en[[[script]]]] [[要素]]によって [[URL]]
を指定して外部の[[スクリプト]]を読み込むことは、
自身の持つ[[特権]]を当該 [[URL]] に対して付与していることになります。
つまり当該 [[URL]] から得られる情報の[[一貫性]]を信頼 (trust) すると宣言していると言えます。
]EG]
[EG[
[59] また [CODE(HTMLe)@en[[[form]]]] [[要素]]によって [[POST]] 先の [[URL]]
を指定することは、秘密のデータを当該 [[URL]] に対して開示することになります。
つまり当該 [[URL]] に送られるデータの秘匿性を信頼 (trust) すると宣言していると言えます。
]EG]
** Origin
[60] あらゆる [[URL]] にそれぞれ個別の保護された領域を与えることもできますが、
それでは実用上不便なので、[[同一起源方針]]にあっては[[ドメイン]]などが共通する [[URL]] 群を
[[起源]] (origin) と呼び、これを保護の単位とします。
[EG[
[61] 例えば [CODE(URI)@en[http://example.com/]] と [CODE(URI)@en[http://example.com/~mypage/]]
は [CODE(URI)[http://example.com]] という共通の[[起源]]を持ちます。しかし
[CODE(URI)[http://www.example.com/]] や [CODE(URI)@en[http://example.com:8080/]]
の[[起源]]はそれぞれ
[CODE(URI)[http://www.example.com]] や [CODE(URI)@en[http://example.com:8080]]
であり、異なります。
]EG]
** Authority
[62] [[起源]]が同じであっても、[[資源]]はそれぞれの権限 (authority) を持っています。
どれだけの権限を与えるかは [[MIME型]]により決まります。
[EG[
[63] 例えば [CODE(MIME)@en[[[image/png]]]] の[[資源]]は[[画像]]であり、 [[API]]
その他へのアクセス権を有しません。一方 [CODE(MIME)@en[[[text/html]]]] の[[資源]]は
[[HTML文書]]であり、[[スクリプト]]の実行その他の様々な権限を有します。
]EG]
** Policy
[64] [[同一起源方針]]においては[[起源]]はそれぞれ別に管理されており、他の[[起源]]との通信は制限されています。
他の[[起源]]の[[API]]アクセスは原則として禁止されていますし、他の[[起源]]の[[資源]]を読み取ることもできません。
他の[[起源]]に情報を送ることは認められていますが、一部の決められた形式に制限されています。
[EG[
[65] 例えば [[DOM]] の [[API]] によって他の[[起源]]の[[文書]]にアクセスすることはできません。
[CODE(DOM)@en[[[postMessage]]]] など例外はありますが、それ以外は [[Webブラウザー]]により厳密に管理されています。
]EG]
[EG[
[66] [[XHR]] によって他の[[起源]]の[[資源]]を読み取ることは、 [[CORS]] により例外的に認められていない限り、
禁止されています。
]EG]
* 適用対象
[9]
いくつかの挙動はそれが同じ[[起源]]に対して行われた操作に由来するか否かによって変化します。
一般に他の[[起源]]の状態や処理結果は取得できません。
@@ このリストは不完全です。
[FIG[
-[20] [CODE(DOMa)@en[[[window]]]] や [CODE(DOMa)@en[[[location]]]]
の[[メンバー]] (一部例外を除きます。) に対する[[スクリプト]]からのアクセス
[SRC@en[[[HTML 5]]]]
--[26] ただし、[[Webブラウザ]]によっては、 [[HTML 5]] で例外とされている[[メンバー]]以外にも異なる[[起源]]の[[スクリプト]]からアクセスできてしまいます。
(例えば [[Gecko]] では [CODE(DOMa)@en[[[name]]]] や [CODE(DOMa)@en[[[status]]]] にアクセスできます。
[CODE(DOMa)@en[[[name]]]] の項を参照。)
-- [84] [CODE(DOMi)@en[[[Window]]]]: [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#security-2>
-- [86] [CODE(DOMi)@en[[[Location]]]]: [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#security-3>
-- [82] [CODE(DOMa)@en[[[frameElement]]]]: [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#dom-frameelement>
-- [127] [CODE(DOMa)@en[[[contentDocument]]]]:
[CITE@en-US-x-hixie[HTML Standard]] ([TIME[2013-11-12 21:53:09 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#dom-iframe-contentdocument>
[CITE@en-US-x-hixie[HTML Standard]] ([TIME[2013-11-12 21:53:09 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#dom-object-contentdocument>
[CITE@en-US-x-hixie[HTML Standard]] ([TIME[2013-11-12 21:53:09 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#dom-frame-contentdocument>
-- [128] [CODE(DOMm)@en[[[getSVGDocument]]]]
-- [83] [[navigation]]: [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#allowed-to-navigate>
-[23] [[CSSOM]] へのアクセス [SRC[仕様なし]]
- [33] 外部資源へのアクセス
--[21] [CODE(DOMi)@en[[[XMLHttpRequest]]]] による[[外部資源]]へのアクセス
[SRC@en[[[XMLHttpRequest]], [[XMLHttpRequest]] 2]]
--[22] [[WebSocket]] による接続 [SRC@en[[[HTML 5]]]]
--[31] [CODE(DOMi)@en[[[Document]]]] [[オブジェクト]]の
[CODE(DOMm)@en[[[load]]]] で読み込める [[URL]]
[DEL[([[MSXML]]、[[Gecko]] など; [[DOM3LS]] [[CR]] にあったが同一起源方針に関する仕様はなし)]] [SRC[>>71]]
--- [71] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#dom-xmldocument-load>
-- [34] [[XSLT]] [CODE(XPathf)@en[[[document()]]]] [[関数]]による別[[起源]]の[[資源]]へのアクセス [SRC[仕様なし]]
-[37] [CODE(DOMa)@en[[[mozIsLocallyAvailable]]]]
- [43] [[SOAP]]
-- <https://developer.mozilla.org/ja/SOAP_in_Gecko-based_Browsers>
- [73] [CODE(DOM)@en[[[onerror]]]]
-- [[エラーミュートフラグ]]
-- [95] [CODE(DOMi)@en[[[[Window]]]]: [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#runtime-script-errors>
-- [96] [CODE(HTMLe)@en[[[iframe]]]]: [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#the-iframe-element>
-- [[navigation]]: [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#navigating-across-documents>
- [74] [CODE(HTMLa)@en[[[seamless]]]]
-- [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#attr-iframe-seamless>
- [77] [CODE(HTMLe)@en[[[canvas]]]] の[[起源汚染]]
-- [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#security-with-canvas-elements>
- [75] [[Web Fonts]] の利用
-- [76] [CODE(DOMm)@en[[[measureText]]]] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-measuretext>
- [78] [CODE(HTMLa)@en[[[autofocus]]]] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#attr-fe-autofocus>
- [80] [CODE(HTMLa)@en[[[ping]]]] [[要求]] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#hyperlink-auditing>
- [81] [[奇癖モード]]における [[[CODE(MIME)@en[Content-Type]]メタデータ]]の扱い [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#link-type-stylesheet>
- [85] [CODE(DOMm)@en[[[replaceState]]]]
-- [91] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#dom-history-replacestate>
-- [92] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#history-traversal>
- [87] [[AppCache]]
-- [88] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#navigating-across-documents>
-- [93] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#concept-appcache-matches-fallback>
-- [94] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#changesToNetworkingModel>
- [89] [[HTTP]] [[redirect]]
-- [90] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#navigating-across-documents>
- [97] [CODE(URI)@en[[[javascript:]]]] [[URL]]: [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#javascript-protocol>
- [98] [[dialog]]: [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#dom-showmodaldialog>
- [99] [CODE(DOMm)@en[[[registerProtocolHandler]]]], [CODE(DOMm)@en[[[registerContentHandler]]]]:
[CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#custom-handlers>
- [100] [CODE(DOMm)@en[[[IsSearchProviderInstalled]]]]:
[CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#dom-external-issearchproviderinstalled>
- [101] [[Web Workers]]: [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#processing-model-4>
- [106] [CODE(DOMa)@en[[[sessionStorage]]]]: [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#the-sessionstorage-attribute>
- [107] [CODE(DOMa)@en[[[localStorage]]]]: [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#the-localstorage-attribute>
- [108] [CODE(DOMe)@en[[[unload]]]] 中の [[navigation]]
-- [[Gecko]] と [[Opera]] では [[same-origin policy]] の対象になります。
[[WebKit]] ではまったく認められていません。
- [109] [CODE(DOMi)@en[[[PerformanceTiming]]]] から値を取得できるか否か
-- [CITE@en[Navigation Timing]] ([TIME[2012-12-13 06:51:35 +09:00]] 版) <http://www.w3.org/TR/2012/REC-navigation-timing-20121217/#sec-navigation-timing-interface>
- [114] [CODE(DOMe)@en[[[error]]]] [[イベント]]が[[発火]]するかどうか [SRC[[[HTML]]]]
]FIG]
[129] [CODE(DOMi)@en[[[Widget]]]] の [CODE(DOMa)@en[[[preferences]]]] にも[[同一起源ポリシー]]が適用されます。
* 起源の値によって動作が変わるもの
[115] [[起源]]が[[三項組]]であるか固有識別子であるか、あるいはその[[三項組]]がどのような値であるかによって、
挙動が変わることがあります。
[FIG[
- [68] [[fetch]] において [CODE(HTTP)@en[[[Referer:]]]] を送出する条件
-- [[起源]]が[[3項組]]で''なければ''、 [CODE(HTTP)@en[[[Referer:]]]] を送っては[['''なりません''']] [SRC[>>67]]。
-- [67] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#fetch>
- [70] [CODE(JS)@en[[[document.cookie]]]] を使える条件
-- [[起源]]が[[3項組]]で''なければ''、 [CODE(JS)@en[[[document.cookie]]]] には読み書きできません [SRC[>>69]]。
-- [69] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#dom-document-cookie>
- [79] [[ダウンロード]]時の[[ファイル名]] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#downloading-hyperlinks>
- [104] [CODE(DOMi)@en[[[WebSocket]]]]
-- [105] [[https:]] から [[ws:]] にはアクセスできない: [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-02-22 20:11:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#dom-websocket>
- [116] [[encoding sniffing algorithm]] において[[親閲覧文脈]]を参照するか否か
-- [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2013-04-30 04:07:36 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#encoding-sniffing-algorithm>
]FIG]
* 適用対象外
[10]
歴史的な理由により、次の場合には同一起源方針は適用されません。
- [CODE(HTMLa)@en[[[src]]]] [[属性]]、
[CODE(HTMLe)@en[[[object]]]] [[要素]]、
[CODE(HTMLe)@en[[[embed]]]] [[要素]]、
[CODE(HTMLe)@en[[[link]]]] [[要素]]などによる外部[[資源]]の埋め込み
-- [CODE(HTMLe)@en[[[img]]]] [[要素]]や [CODE(HTMLe)@en[[[iframe]]]]
[[要素]]など
-- [CODE(HTMLe)@en[[[script]]]] [[要素]]による外部[[スクリプト]]の参照も含みます。
これがそもそも設計上の意図的なものなのか、設計ミスなのかはわかりませんが、
[[JSONP]] などで同一起源方針を擦り抜けるテクニックとしてよく利用されています。
-- これらの[[要素]]や[[属性]]を使うと、本来[[スクリプト]]から取得できないべきである、
異なる[[起源]]の情報を取得することができてしまいます。前述のスクリプト実行だけでなく、
例えば、[[画像]]の大きさを取得することで、その内容を推測できてしまうかもしれません。
-- 外部[[スタイル・シート]]については、非同一起源でも読み込まれて文書に適用されますが、
[[スクリプト]]による [[CSSOM]] の参照に関しては同一起源方針の適用対象になります
(ただし各[[ブラウザ]]とも動作が怪しい)。
-- 外部 [[CSS]] [[スタイル・シート]]中の
[CODE(CSS)@en[[[expression]]()]]
- [[画像]]系 [[CSS]] [[特性]]による外部[[画像]]の埋め込み
- [CODE(CSS)@en[[[-moz-binding]]]] [[特性]]による外部 [[XBL 1.0]]
[[文書]]の読み込み
- [CODE(CSS)@en[@[[import]]]] による外部 [[CSS]] [[スタイル・シート]]の[[輸入]]
- [[Webフォント]]
-- 一部ブラウザ実装。今後の動向次第で変更される可能性あり。
-[18] [[Cookie]]
-- [CODE(HTTP)@en[[[Set-Cookie]]:]] [[頭欄]]内で発行対象の[[ドメイン]]を指定できます。
-- [CODE(JS)@en[[[document.cookie]]]] を使っても書き込みできます。
-[25] [CODE(DOMm)@en[[[postMessage]]]] [[メソッド]]を使うと、
異なる[[起源]]の [[Web頁]]に対して文字列を伝達できます。
-[32] [CODE(HTMLa)@en[[[marginwidth]]]] など[[フレーム]]内の[[余白]]を設定する[[属性]]を使うと、
[[フレーム集合文書]]とは異なる[[起源]]の[[フレーム]]内[[文書]]の[[余白]]を設定できます。
-- [[フレーム]]は [[CSS]] によるレンダリング・モデル以前に実装された歴史的経緯によります。
- [38] [CODE(JS)@en[[[window.name]]]]
- [39] [CODE(HTMLa)@en[[[marginheight]]]], [CODE(HTMLa)@en[[[marginwidth]]]]
- [102] [CODE(DOMi)@en[[[EventSource]]]]
- [103] [CODE(DOMi)@en[[[WebSocket]]]]
* 要調査
@@
- [16] [[XSLT]] [[スタイル・シート]]
- [111] [CODE(XMLe)@en[[[xml]]]] [[要素]]
- [112] [[IE]] [CODE(HTMLa)@en[[[data*]]]]
- [113] [[HTC]] / [[XBL]]
* [11] 制約の緩和
- [15] [CODE(JS)@en[[[document]].[[domain]]]] [[DOM属性]]に値を設定することにより、
[[起源]]となる[[ドメイン名]]を変更することができます。
--ただし、新しい[[ドメイン名]]は元の[[ドメイン名]]の上位階層に当たるものでなければなりません。
- [12] [[CORS]] により、''外部[[資源]]は''、異なる[[起源]]からのアクセスを許可することができます。
-- [13] [[Microsoft]] が提案し、 [[WinIE 8]] で実装している
[CODE(DOMi)@en[[[XDomainRequest]]]] を用いると、
異なる[[ドメイン]]の[[資源]]にアクセスできます。
- [14] [[WinIE]] で実装されている[[セキュリティ・ゾーン]]の機能により、
[[イントラネット]]等[[ゾーン]]毎に、
[[同一起源方針]]を[[利用者]]の設定により緩和することができます。
-[17]
[[Adobe]] [[Air]] は異なる[[起源]]に対する [CODE(DOMi)@en[[[XMLHttpRequest]]]]
でのアクセスを可能にする [CODE(HTMLa)@en[[[allowcrossdomainxhr]]]]
[[属性]]を実装しています。
-[19] [CODE(DOMa)@en[[[globalStorage]]]]
--かつて [[HTML 5]] に含まれていました。
--現在は削除され、代わりに [CODE(DOMa)@en[[[localStorage]]]] が定義されていますが、
こちらは[[同一起源方針]]に完全に従っています。
-- [[Firefox]] 3 が実装しています。
-- [CODE(JS)@en[[[document]].[[domain]]]] [[DOM属性]]の設定と同じようなアクセス制約があります。
- [44] [[Gecko]] は特権を取得することで一部制限を回避できるらしい
-- <https://developer.mozilla.org/ja/SOAP_in_Gecko-based_Browsers>
* 媒体
[30] [CITE[Re: Same-origin checking for media elements]] ([[Ian Hickson <ian@...>]] 著, [TIME[2008-11-17 01:37:36 +09:00]] 版) <http://permalink.gmane.org/gmane.org.w3c.whatwg.discuss/16571>
* 労働者
@@ ・・・
* 局所ファイル
[27] [[HTML5]] は[[局所ファイル]]に関しては[[相互運用性]]に関係しないため適用範囲外として規定していません。
[28] [CITE@ja[Chromeセキュリティモデル、IE/Firefox/Safari/Operaのいいとこ取り | エンタープライズ | マイコミジャーナル]] ([[Mainichi Communications Inc.]] 著, [TIME[2008-12-09 08:24:36 +09:00]] 版) <http://journal.mycom.co.jp/news/2008/12/08/031/>
[29] [CITE[Chromium Blog: Security in Depth: Local Web Pages]] ([TIME[2008-12-13 15:47:53 +09:00]] 版) <http://blog.chromium.org/2008/12/security-in-depth-local-web-pages.html>
* 歴史
[6] 同一起源方針は、 [[Netscape Navigator]] 2.0 で [[JavaScript]]
と共に導入され [SRC[>>1、>>2]]、2.01 および 2.02 で不具合の修正がなされました
[SRC[>>1]]。
[7] [[Internet Explorer]] をはじめとする他ブラウザも同様にこの制限を実装しましたが、
[[ECMAScript]] 仕様や [[DOM]] 仕様としての標準化の対象外とされ、
長らく明文化された規定が存在していませんでした。
[8] [[HTML DOM]] に関係する部分はようやく2005年頃に [[WHATWG]]
によって [[HTML 5]] 仕様の一部として仕様の明文化が行われ始めました。
また、 [[XMLHttpRequest]] に関しては [[HTML 5]] 仕様を参照する形で規定されています。
[126] [CODE(DOMi)@en[[[Document]]]] は、当初は[[オブジェクト]]そのものは取得できるものの、
そのメンバーは一切読み書きできないとなっていましたが、 [CODE(DOMa)@en[[[contentDocument]]]]
などが異なる[[起源]]の場合 [[null]] を返すよう変更され、異なる[[起源]]の [CODE(DOMi)@en[[[Document]]]]
[[オブジェクト]]にアクセスすること自体ができなくなりました。
[REFS[
- [5] '''[CITE@en[RFC 6454 - The Web Origin Concept]] ([TIME[2011-12-12 09:13:37 +09:00]] 版) <http://tools.ietf.org/html/rfc6454>'''
]REFS]
[24] [[起源]]に関する基本的な規定は [[RFC 6454]] となりましたが、2014年に
[[HTML Standard]]、[[URL Standard]]、[[Fetch Standard]] により[[廃止]]されています。
;; [[起源]]を参照。
[REFS[
- [124] [CITE@en[Web Applications 1.0 r8272 Change iframe, frame, and object.contentDocument to return null when cross-origin documents are involved.]] ([TIME[2013-11-13 06:50:00 +09:00]] 版) <http://html5.org/tools/web-apps-tracker?from=8271&to=8272>
- [125] [CITE@en[Web Applications 1.0 r8273 Remove security checks on Document since there should now be no way to get to a Document from another origin.]] ([TIME[2013-11-13 06:53:00 +09:00]] 版) <http://html5.org/tools/web-apps-tracker?from=8272&to=8273>
]REFS]
* メモ
[2]
[CITE[JavaScript Security: Same Origin]] ([CODE[2008-06-18 04:13:16 +09:00]] 版) <http://www.mozilla.org/projects/security/components/same-origin.html>
[1]
[CITE@en[Same origin policy - Wikipedia, the free encyclopedia]] ([CODE[2008-07-02 01:06:45 +09:00]] 版) <http://en.wikipedia.org/wiki/Same_origin_policy>
[35] [CITE@en-us[Same origin policy for JavaScript - MDC]] ([TIME[2009-02-17 13:34:30 +09:00]] 版) <https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript>
[36] [CITE[The Multi-Principal OS Construction of the Gazelle Web Browser - Microsoft Research]] ([TIME[2009-03-07 00:35:15 +09:00]] 版) <http://research.microsoft.com/apps/pubs/default.aspx?id=79655>
[[Webブラウザー]]の[[プロセス]]を[[起源]]毎に分離することによって[[保安性]]の向上を図る[[論文]]だそうです。
[40] [CITE@en[(X)HTML5 Tracking]]
([TIME[2009-09-30 00:11:40 +09:00]] 版)
<http://html5.org/tools/web-apps-tracker?from=4041&to=4042>
[41] [CITE[IRC logs: freenode / #whatwg / 20100223]]
([TIME[2010-02-25 09:03:01 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20100223>
[42] [CITE['''['''whatwg''']''' Canvas 2D Context Proposal: resetOriginClean]]
([TIME[2010-04-25 01:54:34 +09:00]] 版)
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-April/026006.html>
[45] [CITE@en[Guidelines for Web Content Transformation Proxies 1.0]]
( ([TIME[2010-10-22 17:20:31 +09:00]] 版))
<http://www.w3.org/TR/2010/NOTE-ct-guidelines-20101026/#term-same-origin>
[46] [CITE@en[Web Applications 1.0 r5873 Make sure cross-origin fonts can't leak data via <canvas>.]]
( ([TIME[2011-02-11 10:48:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=5872&to=5873>
[47] [CITE[Embedder's Guide - V8 JavaScript Engine - Google Code]]
( ([TIME[2010-11-13 19:00:12 +09:00]] 版))
<http://code.google.com/intl/ja/apis/v8/embed.html>
[48] [CITE@en[draft-abarth-principles-of-origin-00 - Principles of the Same-Origin Policy]]
([TIME[2011-02-22 08:21:31 +09:00]] 版)
<http://tools.ietf.org/html/draft-abarth-principles-of-origin-00>
[49] [CITE@en[Thoughts on font linking and embedding]]
( ([[Maciej Stachowiak]] 著, [TIME[2011-02-17 04:28:23 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-webfonts-wg/2011Feb/0066.html>
[50] [CITE@en[Thoughts on font linking and embedding]]
( ([[Maciej Stachowiak]] 著, [TIME[2011-02-17 04:28:23 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-webfonts-wg/2011Feb/0066.html>
[51] [CITE['''['''whatwg''']''' Canvas and drawWindow]]
([TIME[2011-03-15 13:03:35 +09:00]] 版)
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-March/030862.html>
[52] [CITE[IRC logs: freenode / #whatwg / 20110202]]
( ([TIME[2011-03-19 11:10:11 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20110202>
[53] [CITE[IRC logs: freenode / #whatwg / 20110214]]
( ([TIME[2011-03-23 00:25:04 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20110214>
[54] [CITE[クロスドメイン通信方法のまとめ - nopnopの日記]]
( ([TIME[2011-04-24 11:59:01 +09:00]] 版))
<http://d.hatena.ne.jp/nopnop/20080408/1207669947>
[110] [CITE[''''''[''''''whatwg'''''']'''''' Need to define same-origin policy for WebIDL operations/getters/setters]]
( ([TIME[2013-01-08 08:41:09 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2013-January/038529.html>
[117] [CITE@en[Web Applications 1.0 r7975 Make showModalDialog()'s dialogArguments and returnValue only be useful same-origin, to avoid origins attacking each other]]
( ([TIME[2013-06-15 03:12:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7974&to=7975>
[118] [CITE@en[Web Applications 1.0 r7975 Make showModalDialog()'s dialogArguments and returnValue only be useful same-origin, to avoid origins attacking each other]]
( ([TIME[2013-06-15 03:12:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7974&to=7975>
[119] [CITE[''''''[''''''whatwg'''''']'''''' Adding crossorigin="" to more elements]]
( ([TIME[2013-06-17 19:04:22 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2013-June/039752.html>
[120] [CITE@en[Web Applications 1.0 r7997 Block enumeration of cross-origin objects, and clean up the language around those objects to be more consistent so that differences can more easily be seen.]]
( ([TIME[2013-06-25 05:28:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7996&to=7997>
[121] [CITE@en[Web Applications 1.0 r8090 Remove the weird stuff around document.domain and localStorage. It doesn't really do anything anyway.]]
( ([TIME[2013-07-26 09:13:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8089&to=8090>
[122] [CITE@en[Web Applications 1.0 r8196 Add warning notes to the Security sections of Location and Window since they are in flux with no end in sight.]]
( ([TIME[2013-09-24 06:42:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8195&to=8196>
[123] [CITE[IRC logs: freenode / #whatwg / 20130925]]
( ([TIME[2013-09-26 20:51:11 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130925>
[130] [CITE@en[Web Applications 1.0 r8713 getSVGDocument()]]
( ([TIME[2014-08-07 03:26:00 +09:00]] 版))
<http://html5.org/r/8713>
[72] [CITE@en-US[Same-origin policy - Web security | MDN]]
( ([TIME[2015-01-15 06:35:29 +09:00]] 版))
<https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy>
[131] [CITE@en[524223 – (CVE-2010-0654) Cross-domain data theft using CSS]]
([TIME[2015-02-24 12:35:55 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=524223>
[132] [CITE[Same-origin policy — Anne’s Blog]]
([TIME[2015-03-21 15:12:46 +09:00]] 版)
<https://annevankesteren.nl/2015/02/same-origin-policy>