Security checklist for developers
This document is provided as a supplement to Security for developers. This is a list of common development tasks, and the security measures that need to be taken.
Contents
Security checklist[edit | edit source]
If you are working with ... | have you ... |
---|---|
Cookies[edit | edit source] |
|
Dynamic code generation[edit | edit source] |
Avoid using functions like
Sometimes you really do need these features (obviously For future code that runs only under PHP 5.3 and later, note that inline lambda functions will make it easier to make your callback inline while retaining the benefits of code that's written in native syntax instead of strings.
|
External programs[edit | edit source] |
|
Forms[edit | edit source] |
|
GET data[edit | edit source] |
|
Global variables[edit | edit source] |
|
Output (API, CSS, JavaScript, HTML, XML, etc.)[edit | edit source]Any content that MediaWiki generates can be a vector for XSS attacks. |
|
User provided CSS[edit | edit source]User provided CSS (Say for use in a style attribute) needs to be sanitized to prevent XSS, as well as to disallow insertion of tracking images (via background-image), etc |
|
POST data[edit | edit source] |
|
Query strings[edit | edit source] |
|
Sessions[edit | edit source] |
|
Any user input: no isset![edit | edit source] |
Any
See also Register globals#Sanitize custom global variables before use and Manual:Coding conventions/PHP#Pitfalls. |
Reviewer anxiety[edit | edit source] |
|
SQL queries[edit | edit source] |
See also[edit | edit source]
References[edit | edit source]
Conventions | |
---|---|
General | All languages · Security for developers · Pre-commit checklist · Performance guidelines (draft) · Style guide · Accessibility guide for developers (draft) |
PHP | Code conventions · PHPUnit test conventions · Security checklist for developers |
JavaScript | Code conventions · Learning JavaScript |
CSS | Code conventions |
Database | Code conventions |
Python | Code conventions |
Ruby | Code conventions |
Selenium/Cucumber | Code conventions |