When do you get secure software? When your developers know how to write secure software. That is a no-brainer; yet how often have you quizzed your developers on application security while recruiting them? We present some questions to ask in your next interview in this article
When do you get secure software? When your developers know how to write secure software. That is a no-brainer; yet how often have you quizzed your developers on application security while recruiting them? We present some questions to ask in your next interview in this article.
Ensure the developer is clear about the underlying HTTP requests:
- What is the best method to transmit sensitive data - GET requests or POST requests?
Hint: POST is more secure than GET
- If sensitive data is transmitted in a GET request, they will appear in the browser history, will be recorded in the logs and are susceptible to shoulder surfing.
- The data in POST requests are not visible in History, web server logs or to shoulder surfers.
A lot of vulnerabilities revolve around validation - here are some important questions to ask:
- How would you validate inputs? What is the best way to do it?
- Should validation be done on client side, server side or both client and server side?
- By default, should all inputs be denied and only those inputs that are needed should be allowed?
- Should I create a database of bad inputs and deny them while allowing everything else?
- Should outputs also be validated? Why?
Hint: Reasons for having output validation in the application are;
- Adversaries rely on application outputs for attacks like Cross Site Scripting.
- Error messages are very useful for attackers to launch an attack.
- What are the advantages of using pre-compiled queries in SQL?
Hint: Pre-compiled queries improve performance and security
- Performance improvement comes from the database re-using queries that have already been compiled first time.
- Security improvement comes from resilience against SQL Injection attacks: queries cannot be modified at run-time by SQL Injection anymore.
Quiz them on session management:
- What are the characteristics of a good session token:
Hint: Good token should be:
- Random, not predictable
- Changed after successful login
- Invalidated after logout.
- Timed out after a period of inactivity.
Caching is another area critical to writing secure web applications:
- What’s good and bad about browser caches? How do you control caching from the application?
Hint: Caching improves performance, but can affect security adversely if not done properly.
- Caching improves performance by not downloading content that has not changed. Caching is good for large public files, especially images.
- But, if pages with sensitive data get cached, a local attacker could steal it from the cache. Such web content could include sensitive customer information, like bank statements, account details etc.
- HTTP cache control directives like cache-control: no-store may be used to use the cache securely.
The purpose of this article is to help Project Managers recruit developers with the right mindset and a fundamental ability to think on security issues. Some developers might not know the answers to these questions directly; let them think and if they demonstrate the correct approach, half your battle is already won.
Tags: Best Practices