Content-Access-Controlヘッダ

Security 9月 14, 2007
(Last Updated On: 2007年9月18日)

Flashも同じような事ができるので、JavaScript(XMLHttpRequest)でもできるようにしてしまおう、という規格…

This restriction on “read” access to web resources is very strict and generally appropriate. However, there are scenarios where an application would like to “read” data from another resource on the web without these restrictions and in these scenarios the browser’s default “security sandbox” has to be extended or eased.

つまり「Same Originポリシー」を緩くする規格です。

使い方は簡単

Content-Access-Control: allow <*.example.org> exclude <*.public.example.org>
Content-Access-Control: allow <webmaster.public.example.org>

Means that every subdomain of example.org can access the resource including webmaster.public.example.org, but with the exclusion of all other subdomains of public.example.org.

Content-Access-Control: allow <example.org> <*.example.org>

Means that example.org and all its subdomains can access the resource.

です。選択的にアクセス可能なドメインをContent-Access-Controlヘッダで処理できる、という訳です。

セキュリティ的には「Same Originポリシー」を緩くするのはリスクが高くなる事を意味します。Webセキュリティの根幹である「Same Originポリシー」はどちらにしてもブラウザとプラグイン任せなので、少し緩くしても同じ、という考えなのでしょう。

XMLHttpRequestのプロキシは必要なくなります。確かに作り易くはなりますが必要なのか考えさせられます。

投稿者: yohgaki