Which situation best describes injection?
Injection Risks and Defenses Online Quiz Questions
Use this free practice quiz with 10 questions to review Injection Risks and Defenses, test your knowledge, and prepare for your next test or exam.
What is the central defense against injection?
- A
Reject every input containing punctuation so it cannot affect a command.
- B
Use detailed error messages to reveal when an input is suspicious.
- C
Keep untrusted data separate from instructions using controls suited to the context.
- D
Rely on one security filter to replace other protective controls.
Which set contains only examples of injection?
- A
SQL injection, operating-system command injection, and cross-site scripting
- B
Input validation, least privilege, and secure error handling
- C
Prepared statements, protected logs, and authorization checks
- D
HTML text, HTML attributes, and CSS
A program displays untrusted data in different contexts. Which approach follows the principle of separating data from instructions?
- A
Validate all input and then output it without encoding.
- B
Encode all stored input once, before knowing how it will later be used.
- C
Use the same generic escape operation for every output destination.
- D
Encode untrusted data for the exact context in which it will be interpreted.
An application retrieves a record using a user-supplied ID. Which method best prevents the ID from being interpreted as SQL syntax?
- A
Concatenate the supplied ID into the SQL text after checking its length.
- B
Bind the supplied ID as a value in a parameterized query.
- C
Manually escape the supplied ID before joining it to the SQL text.
- D
Allow the supplied ID to determine the query structure, then filter results.
A user can choose which column to sort by. How should the application handle this structural choice?
- A
Pass the requested table name as a parameter and assume the database will treat it as a value.
- B
Concatenate the requested sort direction into the query after manually escaping it.
- C
Map the requested structural choice to a small allowlist of fixed options.
- D
Let the user supply a complete SQL fragment and validate its length.
A database lookup safely binds a user-supplied record ID as a parameter. What must the application still do?
- A
Check separately whether the user is allowed to access the requested record.
- B
Assume parameter binding authorizes access to every requested record.
- C
Remove the authorization check because the ID is safely bound.
- D
Use a more restrictive input format as a replacement for authorization.
A program needs to create a directory named by a user. Which approach best avoids command injection?
- A
Build a shell command using the directory name, then escape the name manually.
- B
Put the directory name into a command string and reject it only if an error occurs.
- C
Use a generic input filter as a substitute for changing how the command is built.
- D
Use a filesystem library to create the directory without constructing a shell command.
An application must launch an operating-system process using a user-supplied argument. Which approach best reduces command injection risk?
- A
Construct one shell command from the executable and all user-supplied arguments.
- B
Pass a trusted executable and each argument separately through a process API, and validate the arguments.
- C
Pass the full command as one argument and assume this also authorizes it.
- D
Rely on a generic escape function to make any shell command safe.
How does input validation relate to parameterization and context-aware output encoding?
- A
Validation alone safely separates user data from every command and output context.
- B
Validation replaces parameterization as long as malformed inputs are rejected.
- C
Validation complements parameterization and output encoding but does not replace them.
- D
Validation is useful only after an injection has already occurred.
Related study packs and tools
3 Airway, Respiration, and Ventilation
Review EMT airway assessment, breathing mechanics, airway management, ventilation support, and priorities for common respiratory emergencies.
3 Airway, Respiration, and Ventilation
Learn how to assess airway and breathing, distinguish ventilation from oxygenation and respiration, provide appropriate support, and recognize common respiratory emergencies.
4 Cardiology and Resuscitation
Review cardiac assessment and emergencies, adult and pediatric CPR, AED use, and special resuscitation priorities for EMTs.
4 Cardiology and Resuscitation
A medium-difficulty quiz on EMT cardiovascular assessment, cardiac emergencies, CPR, AED use, and special resuscitation considerations.
4 Cardiology and Resuscitation
Learn how EMTs assess cardiac emergencies, recognize poor perfusion, and provide prompt care for cardiac arrest and other resuscitation situations.
6 Medical Emergencies
Review EMT priorities and key recognition and care principles for neurologic, metabolic, respiratory, toxicologic, behavioral, and environmental emergencies.
6 Medical Emergencies
A medium-difficulty quiz on recognizing and responding to medical emergencies within EMT scope and local protocols.
6 Medical Emergencies
Learn how EMTs approach medical emergencies, recognize time-sensitive conditions, provide care within their scope and local protocols, and arrange appropriate transport.
7 Obstetrics, Gynecology, and Pediatric Emergencies
A medium-difficulty quiz on practical assessment, treatment, and transport decisions in obstetric, gynecologic, neonatal, and pediatric emergencies.
8 EMS Operations
A medium-difficulty quiz on applying EMT operational principles to scene safety, communication, incident management, patient rights, and coordinated care.
9 Comprehensive EMT Practice Scenarios and Review
Review EMT exam domains and the priorities, interventions, and responsibilities that guide safe care in common emergency scenarios.
9 Comprehensive EMT Practice Scenarios and Review
Practice applying EMT scene safety, assessment, intervention, transport, and operational principles to realistic situations.