Based on the exhibit, what is the BEST remediation for the application flaw shown?
A user-controlled parameter is being passed to a shell command on the server. The application is intended to test connectivity to approved internal hosts only.
Application log excerpt: 15:08:02 POST /tools/pingHost host=10.0.0.15 15:08:02 Application executed: /bin/sh -c "ping -c 1 10.0.0.15" 15:09:11 POST /tools/pingHost host=10.0.0.15;curl%20http://198.51.100.55/s 15:09:11 Application executed: /bin/sh -c "ping -c 1 10.0.0.15;curl http://198.51.100.55/s" 15:09:12 Outbound HTTPS session established to 198.51.100.55
Based on the exhibit, what is the BEST remediation for the application flaw shown?
A user-controlled parameter is being passed to a shell command on the server. The application is intended to test connectivity to approved internal hosts only.
Answer choices
Good practice is not just finding the correct option. The wrong answers often show the exact trap the exam wants you to fall into.
Keep the current shell command, but add HTML encoding to the response page.
Output encoding helps prevent browser-side issues, but it does not stop command injection on the server.
Replace the shell call with a safe library function and strictly allowlist approved host values.
The flaw is server-side command injection caused by passing user input into a shell. A safe library call removes shell interpretation, and an allowlist limits inputs to known-good targets.
Increase the web server timeout so the ping utility has more time to complete.
Timeout tuning does not prevent an attacker from appending extra shell commands to the request.
Require users to authenticate before they can access the page.
Authentication may reduce exposure, but it does not correct the underlying unsafe command execution.
Common exam trap
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
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.
Related practice questions
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Practise SY0-701 questions linked to Security+ social engineering questions.
Practise SY0-701 questions linked to Security+ cryptography.
Practise SY0-701 questions linked to Security+ IAM questions.
Practise SY0-701 questions linked to Security+ risk management questions.
Practise SY0-701 questions linked to Security+ incident response questions.
Practise SY0-701 questions linked to Security+ malware questions.
Practise SY0-701 questions linked to Security+ vulnerability management questions.
Practise SY0-701 questions linked to Security+ security operations questions.
Practise SY0-701 questions linked to Security+ zero trust questions.
Practise SY0-701 questions linked to Security+ authentication factors questions.
Keep practising from the same exam bank, or move into a focused topic page if this question exposed a weak area.
Question 1
Question 2
Question 3
Question 4
Question 5
Question 6
FAQ
Static NAT maps one inside address to one outside address.
The correct answer is: Replace the shell call with a safe library function and strictly allowlist approved host values. — The exhibit shows OS command injection: the application builds a shell command directly from user input, and the attacker appends a second command using a semicolon. The best remediation is to remove shell interpretation by calling a safe library or API function and to restrict inputs with a strict allowlist of approved hosts. This addresses both the injection path and the application’s intended business requirement. Authentication or output encoding alone would not fix the flaw. Why others are wrong: HTML encoding only affects how responses are displayed and does nothing to stop the server from executing injected shell commands. Extending timeouts may make normal pings more reliable, but it does not mitigate command chaining. Authentication is valuable, yet even authenticated users could exploit the flaw unless the command execution pattern is redesigned to avoid shell expansion entirely.
Then try more questions from the same exam bank and focus on understanding why the wrong options are tempting.
Sign in to join the discussion.