149.34.228.10- [28/Jan/2023:16:32:45-0300] "GET / HTTP/1.0" User-Agent: ${/bin/sh/ id} 200 397
Which of the following should be used to best mitigate this type of attack?"
Input sanitization is the best choice to mitigate this type of attack.
Input sanitization is crucial in preventing injection attacks, such as the one indicated by the presence of `${/bin/sh/ id}` in the User-Agent string. By ensuring that only valid data is processed, input sanitization can effectively block malicious commands from being executed on the server.
Input sanitization involves validating and cleaning user inputs to prevent harmful data from being executed. In this scenario, the injection of shell commands through the User-Agent header shows that the system is vulnerable to such attacks. Implementing input sanitization would help filter out potentially malicious input, thus mitigating the risk of exploitation.
Secure cookies are designed to protect session data from being intercepted in transit, particularly over HTTPS. While they enhance security by ensuring that cookies are only sent over secure connections, they do not address the underlying issue of input validation. Therefore, secure cookies would not mitigate the attack described in the logs.
Static code analysis is a method used to analyze source code for vulnerabilities before deployment. Although it can help identify potential security flaws in the code, it does not directly prevent attacks that exploit already deployed applications. Thus, it is not an immediate solution for mitigating the type of injection attack evident in the log entry.
Sandboxing involves executing code in a controlled environment to prevent it from affecting the host system. While sandboxing can contain the effects of a successful attack, it does not prevent the attack from occurring in the first place. Therefore, it is not an effective primary defense against the type of input injection demonstrated in this situation.
To effectively mitigate injection attacks like the one illustrated in the log, input sanitization is essential. It directly addresses the risk by filtering out harmful inputs before they can be executed by the server. Other options may enhance security in different ways, but only input sanitization specifically targets the prevention of malicious code execution through user inputs.
Related Questions
View allA software developer wishes to implement an application security techn...
A company is required to use certified hardware when building networks...
Which of the following control types describes an alert from a SIEM to...
Which of the following should be used to ensure an attacker is unable...
Which of the following attacks primarily targets insecure networks?
Related Quizzes
View allCompTIA A Plus Certification Exam
CompTIA A Plus Exam Questions
CompTIA A Plus 1001 Exams Practice
CompTIA A Plus Practice Exam
CompTIA CySA+ Cybersecurity Analyst Certification all in One Exam Guide
CompTIA Network Plus Certification Exam Quiz
Free CompTIA Security Plus Practice Test
CompTIA Security Plus Simulation Questions
CompTIA Security Plus 501 Practice Questions
CompTIA Security Plus Example Questions
- ✓ 500+ Practice Questions
- ✓ Detailed Explanations
- ✓ Progress Analytics
- ✓ Exam Simulations