Question 340
A public-facing WAF blocks SQL injection patterns, but a trusted internal batch service can call the same database-backed API without passing through the WAF. Which control prevents SQL injection regardless of the caller network path?
Explanation
Correct Answer
Parameterized queries keep untrusted data values separate from executable SQL syntax, regardless of whether those values originate at a public browser or an internal batch service. Server-side validation and least-privilege database permissions add defense in depth, but input filtering alone does not replace parameter binding. Because the internal route bypasses the WAF, the lasting protection belongs in the application query construction. This item evaluates a shared application invariant rather than repeating a network-origin allowlist decision.
Incorrect Answers
More WAF telemetry can help detect attempted attacks on the public route, but the internal caller never traverses that inspection point. Continuing to build SQL with concatenated untrusted data leaves a direct injection opportunity. Detection is not equivalent to removing the unsafe query-construction behavior. The server application must use safe parameter binding for every caller and retain logging as complementary incident evidence.
A perimeter default-deny firewall limits external network reachability, but it may still permit authenticated internal batch traffic with dangerous input. If the application constructs SQL by concatenating values, an allowed route can carry an injection payload to the vulnerable interpreter. Network segmentation can reduce who can reach the API; it cannot substitute for separating executable query structure from data within the application.
Disabling audit logs does not alter how SQL is parsed and may conceal malicious or mistaken batch operations. It makes it harder to determine what input triggered a failed query and who initiated it. If logging affects throughput, the organization can tune collection securely, but the injection flaw remains until the application uses safe parameter binding. Removing a detective control does not replace a preventive coding safeguard.






CompTIA Security+ (SY0-701) Practice Tests