タグ

jsonとsecurityに関するlesamoureusesのブックマーク (3)

  • The JSON SQL Injection Vulnerability

    tl;dr Many SQL query builders written in Perl do not provide mitigation against JSON SQL injection vulnerability. Developers should not forget to either type-check the input values taken from JSON (or any other hierarchical data structure) before passing them to the query builders, or should better consider migrating to query builders that provide API immune to such vulnerability. Note: 問題の発見者による日

    lesamoureuses
    lesamoureuses 2014/07/01
    stringならいいけどobject(?)が来るとそのまま解釈して演算子扱いされるのか “If the supplied input is {"name": {"!=", ""}}, then the query condition becomes name!='' and the database will return all rows with non-empty names.”
  • JSONのエスケープをどこまでやるか問題 - 葉っぱ日記

    Ajaxなアプリケーションにおいて、サーバからJSONを返す場合に、JSON自体はvalidであるにも関わらず、(IEの都合で)エスケープが不足していて脆弱性につながってる場合があるので、書いておきます。 発生するかもしれない脆弱性 JSONのエスケープが不足している場合に発生する可能性のある脆弱性は以下の通りです。 JSON内に含まれる機密情報の漏えい XSS それぞれの詳細については後述します。 開発側でやるべきこと 文字列中のUnicode文字は "\uXXXX" な形式にエスケープするとともに、ASCIIな範囲であっても「/」「<」「>」「+」も同様にエスケープすることにより、前述の脆弱性を防ぐことができます。 Perlであれば、以下のような感じになります。JSON->ascii(1) に続けて、JSON文字列を正規表現で置換しているあたりがキモになります。 use utf8; u

    JSONのエスケープをどこまでやるか問題 - 葉っぱ日記
  • Amon2とJSONとセキュリティ - tokuhirom's blog

    [1]http://d.hatena.ne.jp/ockeghem/20110907/p1[2]http://www.atmarkit.co.jp/fcoding/articles/webapp/05/webapp05a.html[3] http://msdn.microsoft.com/ja-jp/asp.net/ff713315[4] http://labs.cybozu.co.jp/blog/kazuho/archives/2007/01/cross-site_including.phpあたりをよんで、JSON とセキュリティについてかんがえてみた。 ここで、有効とされている対策のうち while(1); を先頭に付与するPOST ですべて処理するといったあたりは、RESTful でないし、BK 感がひどいというか質的ではないのでできるだけやりたくない。 また、Amon2 では互換

    lesamoureuses
    lesamoureuses 2011/11/25
    最後のまとめを覚えておく。> GET リクエストである Cookie ヘッダを送信している /android/i にマッチする User-Agent ヘッダを付与している X-Requested-With ヘッダを付与していない
  • 1