タグ

jsonに関するken-tonのブックマーク (2)

  • Node.js - Best practices

    This document discusses best practices for handling errors and callbacks in Node.js applications. It covers techniques like error delegation, exception handling, error-first callbacks, avoiding nested callbacks, and using control flow libraries. It also discusses deployment strategies like using screen, restarting crashed processes, and innovating with platforms like Joyent, Nodejitsu and Heroku.R

    Node.js - Best practices
  • JSONのエスケープをどこまでやるか問題 - 葉っぱ日記

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

    JSONのエスケープをどこまでやるか問題 - 葉っぱ日記
  • 1