Q: Which of the following are secure programming guidelines?
A) Always validate input for public methods.
B) Never use input data as input for a format string.
C) Avoid the use of environment variables.
D) Always call a shell to invoke another program from within a C/C++ program.
F) None of the above options
E) A), B) and C)
A
Answer:
A
Explanation:
The correct option is:
E) A), B) and C)
Explanation: Secure programming guidelines include:
- A) Always validate input for public methods: Input validation helps to prevent common vulnerabilities such as injection attacks.
- B) Never use input data as input for a format string: Using untrusted input in format strings can lead to vulnerabilities like format string attacks.
- C) Avoid the use of environment variables: Environment variables can potentially be manipulated by attackers, leading to security risks.
These practices are part of creating secure software and preventing common vulnerabilities.
Related Topic:
Share Above MCQ