2.4 Secure Coding Practices Flashcards
What does output encoding do?
Output encoding replaces the potentially dangerous character with an equivalent string that produces the same result but doesn’t have the risk of manipulating the application.
What does HTML encoding do?
Uses ampersand (&) notation to replace dangerous values that appear in an HTML-based web document.
URL Encoding
Uses percent sign (%) notation to replace dangerous values that appear in a URL.
What is input validation.
It’s the filtering of user-supplied input.
What security concerns do user-supplied input raise?
User-supplied input may contain code designed to interact with the database, manipulate the browsers of future visitors to the site, or perform any of a number of other attacks.
The Two Appraches to Input Validation
Whitelisting and Blacklisting
What does input validation via whitelisting do? And what’s its downside?
Specifies allowable input. Not always practical.
What is blacklisting in the context of input validation? What’s it’s main characteristic (pro/con).
Specifies disallowed input. More difficult and less effective than whitelisting.
Should input validation be performed on the client or on the server? Why?
On the server.
The user controls the browser, and the user can disable the input validation routine if you validate input on the client side
What are parameterized queries?
In a parameterized query, the SQL template is precompiled on the database server.
The client does not send the SQL code to the database server. Instead, the client sends arguments to the server which then inserts those arguments into a pre-compiled query template.
This protects against injection attacks and improves database performance.
What’s one way that you should never store a password?
Plaintext
What does hashing do?
Uses a cryptographic function to transform the password into a unique value that can’t be reversed.
What is salting? What does it protect against?
Adding a random value to passwords prior to hashing.
Against rainbow table attacks.
In what form should the passwords be in transit?
Encrypted.
What does Transport Layer Security (TLS) do on a high level?
Encrypts web traffic.