WebアプリケーションにおいてJSONを用いてブラウザ - サーバ間でデータのやり取りを行うことはもはや普通のことですが、このときJSON内に第三者に漏れては困る機密情報が含まれる場合は、必ず X-Content-Type-Options: nosniff レスポンスヘッダをつけるようにしましょう(むしろ機密情報かどうかに関わらず、全てのコンテンツにつけるほうがよい。関連:X-Content-Type-Options: nosniff つかわないやつは死ねばいいのに! - 葉っぱ日記)。 例えば、機密情報を含む以下のようなJSON配列を返すリソース(http://example.jp/target.json)があったとします。 [ "secret", "data", "is", "here" ] 攻撃者は罠ページを作成し、以下のようにJSON配列をvbscriptとして読み込みます。もちろ
先日、非常に珍しい、GPSつかったチャットの脆弱性を発見したので、ここに注意もかねて書いておく。 簡単に言うと、WebSocketに生で自分でGPS座標を送り、相手との距離差を何度でも取得できる脆弱性で、離れてる、近いくらいしか分からないことを前提にGPS使用を許可してる時に〜町にいる、とわかってしまうという、聞いたことない感じの珍しい脆弱性である。websocketでイベント駆動にしてるとついうっかりステート管理があやふやになりがちである。 さて、下記は脆弱性の存在したchatpad.jpのサポートに送ったメールである。 Subject: GPSを使用した機能に関する脆弱性について 初めまして。いつも楽しくChatPad使わせて頂いております。 件名の通り、GPSに関する脆弱性を発見しました。これは相手の住所が相手の意図に反し 高精度(最大で市町村程度まで)特定できてしまうというもので、
Stack Overflowに面白い質問があったので紹介する javascript - Why does Google prepend while(1); to their JSON responses? - Stack Overflow 質問 Googleのサービス内で使われるJSONの先頭に while(1); てついているのは何故? 例えばGoogle Calendarではカレンダーを切り替えるときに以下のような内容のデータがサーバから返される。 while(1);[['u',[['smsSentFlag','false'],['hideInvitations','false'],['remindOnRespondedEventsOnly','true'],['hideInvitations_remindOnRespondedEventsOnly','false_true'],['C
とある通販サイトで適当にパスワード打ち込んだら、後日思い出せなくなって涙目になったのでカッとなってパスワードジェネレーターを作ってみた。 Bookmarklet にしてご利用ください。Firefox 8.0でのみ動作確認しています。 概要 ソースコードは最下部に記載しています。ドメイン名とマスターパスワード(Salt)から、都度パスワードを算出する Bookmarklet です。マスターパスワードが変わらない限り、同じドメインのページでは常に同じパスワードが発行されますので、もうこのサイトのパスワード何だったっけ、と頭を悩ます必要がありません。ただし、マスターパスワードが漏洩すると元も子もありませんので、マスターパスワードの管理だけはしっかりするようにしてください。 初回実行時には記号使用の有無と文字数を聞かれます。これらの値はブラウザの LocalStorage に保存されるため、履歴が
はてなグループの終了日を2020年1月31日(金)に決定しました 以下のエントリの通り、今年末を目処にはてなグループを終了予定である旨をお知らせしておりました。 2019年末を目処に、はてなグループの提供を終了する予定です - はてなグループ日記 このたび、正式に終了日を決定いたしましたので、以下の通りご確認ください。 終了日: 2020年1月31日(金) エクスポート希望申請期限:2020年1月31日(金) 終了日以降は、はてなグループの閲覧および投稿は行えません。日記のエクスポートが必要な方は以下の記事にしたがって手続きをしてください。 はてなグループに投稿された日記データのエクスポートについて - はてなグループ日記 ご利用のみなさまにはご迷惑をおかけいたしますが、どうぞよろしくお願いいたします。 2020-06-25 追記 はてなグループ日記のエクスポートデータは2020年2月28
Java変態文法最速マスター - プログラマーの脳みそをリスペクト。 JavaScriptの変態文法・技法一覧です。あんまり使わないけど、知ってるとXSSとか攻撃したいのにWAFに妨害されるなど、いろいろ制約があるという場合に便利。 文字列の生成 引用符を使わずにさくっと文字列を作る。fromCharCode とか使ってもいいけどめんどくさいので、正規表現やE4Xを利用。 alert( /string/.source ); alert( <>string</> ) 空白文字を使わず記述 文脈上、スペースを書きたいけれどいろいろ制約があって書けない場合にはコメントで代替。実行するコードを作り上げてevalしてもいいけど大袈裟なので。 var/**/x=1; */ を含むコードブロックをコメントアウト コードの塊りをコメントアウトしようと思って /* */ で囲むと、コード内に string.
jCryption.orgは8月2日、HTMLフォームを暗号化できるオープンソースJavaScriptライブラリ「jCryption 1.0」を公開した。ライセンスはMIT Licenseを利用、Google Codeのプロジェクトページよりダウンロードできる。 jCryptionは、HTMLフォームデータ(POST/GET-Data)を暗号化するプラグイン。RSAアルゴリズムとjQueryを利用してクライアント側でデータを暗号化する。解読は、サーバー側でPHPを利用して行う。 SSLがない状態でもデータを高速かつシンプルに暗号化できることが特徴だが、認証の機能がないことなどから、SSLの代わりにはならないとしている。土台レベルのセキュリティ提供を目指すという。 「Internet Explorer 6」以上、「Mozilla Firefox 3」以上、「Opera 9」以上、「Safar
「Hacking Intranet Websites from the Outside」という講演が2006年にありました。 Black Hatでの講演です。 以下に説明する手法は既に公開されてある程度時間が経過している情報なので、ご存知の方にとっては既に古いとは思います。 詳細はプレゼン資料をご覧下さい。 概要 ファイアウォールなどに守られたイントラネットやホームネットワークの内部を攻撃する手法が解説してありました。 JavaScriptの基本仕様を組み合わせて情報を収集するというものでした。 最終的には、プリンタから印刷を行ったり、ルータの設定を変更するなどの攻撃が可能になるようです。 それ以外にも、Web経由で設定変更が出来るものは状況によっては影響されるかも知れません。 プレゼン後半ではCSRF(XSRF, cross-site request forgery)も解説されていました
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く