mediummultiple choiceObjective-mapped

After a new search feature goes live, logs show requests containing `UNION SELECT` and the application returns database error messages. Security testing confirms attackers can retrieve rows from other tables by modifying the query string. Which fix is best?

Question 1mediummultiple choice
Full question →

After a new search feature goes live, logs show requests containing `UNION SELECT` and the application returns database error messages. Security testing confirms attackers can retrieve rows from other tables by modifying the query string. Which fix is best?

Answer choices

Why each option matters

Good practice is not just finding the correct option. The wrong answers often show the exact trap the exam wants you to fall into.

A

Best answer

Rewrite the database access layer to use parameterized queries or prepared statements.

Parameterized queries separate user input from SQL code, which prevents attacker-controlled strings from changing the query structure. That directly addresses the injection flaw rather than only hiding symptoms. Because the app is already returning database errors and leaking data, the safest fix is to eliminate dynamic SQL construction at the source of the problem.

B

Distractor review

Encode special characters in the browser before submitting the search form.

Client-side encoding can be bypassed and does not protect the server if unsafe query construction still exists.

C

Distractor review

Disable detailed error messages so attackers cannot see the database name.

Hiding errors reduces information leakage, but it does not stop SQL injection or unauthorized data access.

D

Distractor review

Increase password complexity requirements for all application users.

Stronger passwords help account security, but they do not correct the input validation and query construction failure.

Common exam trap

Common exam trap: NAT rules depend on direction and matching traffic

NAT is not only about the public address. The inside/outside interface roles and the ACL or rule that matches traffic are just as important.

Technical deep dive

How to think about this question

NAT questions usually test address translation, overload/PAT behaviour, static mappings and whether the right traffic is being translated. Read the interface direction and address terms carefully.

KKey Concepts to Remember

  • Static NAT maps one inside address to one outside address.
  • PAT allows many inside hosts to share one public address using ports.
  • Inside local and inside global describe the private and translated addresses.
  • NAT ACLs identify traffic for translation, not always security filtering.

TExam Day Tips

  • Identify inside and outside interfaces first.
  • Check whether the scenario needs static NAT, dynamic NAT or PAT.
  • Do not confuse NAT matching ACLs with normal packet-filtering intent.

Related practice questions

Related SY0-701 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

More questions from this exam

Keep practising from the same exam bank, or move into a focused topic page if this question exposed a weak area.

FAQ

Questions learners often ask

What does this SY0-701 question test?

Static NAT maps one inside address to one outside address.

What is the correct answer to this question?

The correct answer is: Rewrite the database access layer to use parameterized queries or prepared statements. — Parameterized queries or prepared statements are the best fix because they prevent user input from being interpreted as SQL syntax. The scenario shows a classic injection path: attacker-supplied query fragments are changing the database command and extracting unauthorized rows. Addressing the query construction itself is far more effective than trying to hide errors or sanitize only on the client side. Why others are wrong: Browser-side encoding can be bypassed and does not protect the server-side query engine. Disabling errors may reduce clues for attackers, but the injection still works and data can still be exposed. Password complexity is unrelated to the application’s input handling issue and would not stop the exploitation path described in the logs.

What should I do if I get this SY0-701 question wrong?

Then try more questions from the same exam bank and focus on understanding why the wrong options are tempting.

Discussion

Loading comments…

Sign in to join the discussion.