44.0k views
1 vote
According to OWASP, which of the following are secure coding techniques? (Choose all that apply)

a) Input validation

b) Security headers

c) Obfuscation

d) Commenting out code

User Shikiryu
by
7.3k points

2 Answers

6 votes

Final answer:

According to OWASP, input validation and security headers are secure coding techniques.

Step-by-step explanation:

According to OWASP (Open Web Application Security Project), secure coding techniques are practices used to develop software that is resistant to vulnerabilities and attacks. Based on OWASP's recommendations, the following are secure coding techniques:

  1. Input validation: This involves checking and validating all user input to ensure it meets the expected format and range. It helps prevent various types of attacks such as injection attacks.
  2. Security headers: These are HTTP headers that provide instructions to the browser on how to handle certain security-related aspects. For example, the 'Content-Security-Policy' header can be used to restrict the types of content that are allowed to be loaded on a webpage.

On the other hand, obfuscation and commenting out code are not considered secure coding techniques. Obfuscation is a technique used to make code difficult to understand or reverse engineer, but it does not inherently improve security. Commenting out code refers to temporarily disabling sections of code, which may lead to vulnerabilities if the commented-out code was meant to implement security measures.

User Shvet Chakra
by
8.5k points
6 votes

Final answer:

The secure coding techniques according to OWASP are input validation and security headers. Obfuscation is not typically considered secure coding, and commenting out code is not a secure technique.

Step-by-step explanation:

According to OWASP, which stands for the Open Web Application Security Project, secure coding is essential to prevent vulnerabilities and attacks on web applications. From the choices provided:

  • Input validation is indeed a secure coding technique. It ensures that only properly formatted data is entered into a system.
  • Security headers can provide additional layers of security by enforcing browser behaviors like content security policies.
  • Obfuscation is a method that can make the code more difficult to understand for an attacker, but it is not typically considered a secure coding practice, because it doesn't prevent attacks but rather makes the code harder to read.
  • Commenting out code is not a secure coding technique. It can lead to security misconfigurations if sensitive information is exposed.

Therefore, the correct answers that represent secure coding techniques according to OWASP are input validation and security headers.

User Christian
by
7.9k points