D. Securing Web Applications
THE FOLLOWING ARE A FEW GUIDELINES on how to secure web applications. For further reading on this subject, visit the owasp.org website.
- Validate browser input (parameters, special characters, SQL injections) on the server side, not just the client side (that is, JavaScript). If you are working directly with JDBC, consider using
java.sql.PreparedStatement versus a java.sql.Statement.
- Don’t use a shell (Runtime.exec) in your web-related code; this is almost certainly an open invitation to hackers.
- Do not store sensitive data anywhere (databases, files, and so on). If you absolutely must store this information, store it in encrypted form.
- Don’t allow direct access to any system resource—for example, files, databases, ...