Best Mitigations for JavaScript Injection on Web Servers?
An organization's web servers host an online ordering system. The organization discovers that the servers are vulnerable to a malicious JavaScript injection, which could allow attackers to access customer payment information. Which of the following mitigation strategies would be most effective for preventing an attack on the organization's web servers? (Choose two.)
Community Votes
100% of anonymous learners picked answer AD. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
This question tests specific web application defenses, where the trap is choosing generic security measures like encryption or password policies instead of active threat mitigation tools like WAFs and patching.
To prevent malicious JavaScript injection attacks like XSS, the most effective strategies are keeping server software patched and using a Web Application Firewall (WAF). The community consensus strongly supports these two methods for securing web servers against code injection vulnerabilities.
Choosing 'Encrypting sensitive data' (Option C) because the question mentions payment information, confusing data protection with attack prevention.
Community Discussion (4 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Regularly updating server software (Option A) patches the underlying vulnerabilities that allow JavaScript injection, such as flaws in libraries or frameworks. Utilizing a Web Application Firewall (Option D) provides a dedicated security layer that inspects HTTP traffic and actively blocks malicious scripts before they reach the application.Why the Other Options Are Wrong
Strong password policies (Option B) do not mitigate code injection attacks, which target input validation rather than authentication. Encrypting data (Option C) protects the confidentiality of data at rest or in transit but does not prevent the malicious code from executing in the first place. While vulnerability scans (Option E) are useful for identifying issues, they are a detection mechanism rather than a prevention mechanism like a WAF.Community Comment Notes
Community members emphasize that updates address the root cause of the vulnerability, while WAFs serve as a critical shield against known attack signatures. One useful comment clarified that while vulnerability scans are important, they do not offer the immediate, active protection required to stop an ongoing injection attempt compared to a WAF.Official Reference
Exam Strategy
Focus on the specific attack vector—in this case, injection—and choose options that directly address code execution or traffic filtering. Avoid answers that simply protect the data (like encryption) if the question asks how to prevent the attack itself.
Related Analysis
Practice All SY0-701 Questions
Access 100 questions with complete answers and detailed explanations.
View Full SY0-701 Practice Test →