官术网_书友最值得收藏!

  • React Cookbook
  • Carlos Santana Roldan
  • 147字
  • 2021-07-16 17:49:42

There's more...

Here are some security recommendations:

  • Always sanitize users' content that comes from forms.
  • Always use serialize instead of JSON.stringify.
  • Use dangerouslySetInnerHTML only when absolutely necessary.
  • Do unit tests for your components, and try to cover all the possible XSS attacks (we are going to see unit tests in Chapter 12, Testing and Debugging).
  • Always encrypt passwords with sha1 and md5, and do not forget to add a salt value (for example, if the password is abc123, then your salt can be encrypted like this: sha1(md5('$4ltT3xt_abc123')).
  • If you use cookies to store sensitive information (personal information and passwords mainly), you can save the cookie with Base64 to obfuscate the data.
  • Add some protection to your API (security tokens) unless you need to be public. There is a recipe about security tokens in Chapter 8, Creating an API with Node.js Using MongoDB and MySQL.
主站蜘蛛池模板: 牙克石市| 祁东县| 丰台区| 三河市| 偃师市| 禹城市| 米泉市| 徐水县| 昭平县| 灵宝市| 扎兰屯市| 鲜城| 资兴市| 瑞昌市| 惠来县| 莱西市| 桓台县| 循化| 弋阳县| 武安市| 沙河市| 商洛市| 文安县| 沙湾县| 汶上县| 格尔木市| 定远县| 浮梁县| 芦溪县| 军事| 峡江县| 鹤山市| 沙田区| 锦屏县| 纳雍县| 沂水县| 会宁县| 循化| 申扎县| 司法| 闽侯县|