Wenn der größte Teil der Logik in JavaScript stattfindet, dann findet auch der größere Teil der Sicherheitsrisiken dort seine Heimat. Und Angreifer finden mit JavaScript eine interessante neue Umwelt, denn die Sprache selbst und auch ihre Heimat in Browser und Node.js bringen viele neue Probleme. Und genau da setzt der Vortrag an: die verblüffenden Unterschiede von JavaScript zu anderen Sprachen,
I was playing around with new operators when I noticed something cool and unexpected. If you return a function the new operator will not create a new object instance but instead return a function. This means that stuff like: new new new new new new function f(){return f} Is perfectly valid code. That made me think maybe it would cause a crash. Yep course it does on IE: eval(Array(0xffff).join('new
ECMAScriptの仕様では、0x0A/0x0D以外にU+2028/2029の文字も改行とすることが明記されています。 これはあまり知られていないように思います。 以下はアラートを出します。 <script> //[U+2028]alert(1) </script> 知られていないだけでなく、知っていたとしても、スクリプトで文字列を処理するときに、U+2028/2029まで考慮する開発者がどれだけいるのかという話です。 実際、U+2028/2029を放り込むと文字列リテラル内にその文字が生のまま配置され、エラーが出るページは本当にたくさんあります。まあ、エラーがでるだけなら、大抵の場合大きな問題にはなりません。 ところが、U+2028/2029によってXSSが引き起こされてしまう場合というのを最近実際に見ました。 Googleのサービスで見つけた2つのケースを取り上げたいと思います。 ケ
XMLHttpRequest (XHR) の結果を Document として受け取る場合に、 xhr.response.URL が GM_xmlhttpRequest で言うところの finalUrl 相当の値を返すように(仕様上は)なっている、という話をこれまで何回か書いてきたのだけれど、気がついたら Editor’s Draft だけでなく Working Draft にも反映されていた。 これは XMLHttpRequest Living Standard にも同じく反映されている。そのこと自体を喜ばしく思う一方で、現時点ではどのブラウザもこの仕様を反映してはいないようだ。というわけで手始めに Firefox にバグとして報告して、ついでにパッチも書いた。Bug 859095ただしこれまでブラウザ拡張では xhr.response.URL が cross origin へのリクエスト
Badass JavaScriptA showcase of awesome JavaScript that pushes the boundaries of what's possible on the web, by @devongovett. The W3C is working on a cryptography API for JavaScript, which will enable JavaScript to perform “basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for
3回目となる今回は、サービス間の連携におけるlocalStorageとpostMessageの使いどころについて解説します。localStorageはWeb Storage、postMessageはCross-document messagingまたはWeb MessagingとしてHTML5の仕様に含まれているAPIです。どちらもIE(Internet Explorer)8以降、Firefox 3以降、Safari 4以降と、近年のモダンなブラウザで幅広くサポートされており、iPhone用のSafariやAndroidの標準ブラウザでも使うことができます。 localStorageとCookieの違い Cookieは一時的にデータを書き込んで保存させるしくみとして長い歴史を持っていますがさまざまな問題を抱えており、使い方には注意する必要があります。ここで取り上げるlocalStorage
Map Your Next Move at VMware Explore Join peers and leaders at the essential cloud event for IT professionals. Learn More Join Broadcom Rewards Join the Broadcom Rewards Program to earn exclusive swag and experiences. Register for Broadcom Rewards Map Your Next Move at VMware Explore Join peers and leaders at the essential cloud event for IT professionals. Learn More Welcome to the Broadcom Commun
This is a followup to my earlier post on javascript in EPUB, this time focusing on EPUB javascript security. Every industry has its apocryphal tales, stories that are presented as true but too neatly demonstrate the truths of day-to-day work, too tailored to their message, to be entirely true. Stories are a big part of every industry’s true education. They highlight dangers, reset expectations, an
第1回外部サイトに貼り付けるJavaScriptの作法―ポリシー、速度、セキュリティ、プライバシー(3) mala 2012-07-04 第1回外部サイトに貼り付けるJavaScriptの作法―ポリシー、速度、セキュリティ、プライバシー(2) mala 2012-07-03
The web's security model is based on a same-origin policy. For example, code from https://mybank.com must have access to only https://mybank.com's data, and https://evil.example.com must never be allowed access. Each origin is, in theory, kept isolated from the rest of the web, giving developers a safe sandbox to build in. In practice, however, attackers have found several ways to subvert the syst
動的に生成できるといいよね。 ってことで、JavaScriptコードを書いた。 文字列生成の結果を見るためにブラウザで動作するサンプル セキュリティに配慮したwebサイトは、レスポンスヘッダに Origin : domainだとかを加えたりして、サーバーの応答も細かく調整するんだけど、ブラウザ側でもサーバーの指定した制限事項に従って「コンテンツを保護しつつ表示したい」よね。ってことでContent Security Policy を適用する。 信頼できるドメインを指定したり、JavaScriptの挙動を許可したりすることで、外部からの攻撃を防ごうという機能。 取り敢えず、レスポンスヘッダをごにょごにょすると、「対応したブラウザの挙動」はサイトの指定した制限を受けることになる。 たとえば、最も単純な CSP用のレスポンスヘッダを返却するように指定すると、ブラウザのCSP制限で inline
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く