The document provides 10 rules for safer code in order to prevent security vulnerabilities:
1. Do not use eval() or evaluate strings as code.
2. Do not use pickle for serialization as it is unsafe and not secure.
3. Use ORM queries and query parameters instead of direct SQL to prevent SQL injection.
4. Be careful of XSS vulnerabilities in templates, DOM manipulations, and uploads. Escape variables and user input.
5. Securely store passwords and tokens and do not leak them.
6. Review sudo() usage and do not allow blind writes from public methods.
7. Use CSRF tokens for HTTP POST forms to prevent CSRF attacks.
Related topics: