exam questions

Exam CAS-005 All Questions

View all questions & answers for the CAS-005 exam

Exam CAS-005 topic 1 question 3 discussion

Actual exam question from CompTIA's CAS-005
Question #: 3
Topic #: 1
[All CAS-005 Questions]

A security architect discovers the following while reviewing code for a company's website: selection = "SELECT Item FROM Catalog WHERE ItemID = " & Request("ItemID")
Which of the following should the security architect recommend?

  • A. Client-side processing
  • B. Query parameterization
  • C. Data normalization
  • D. Escape character blocking
  • E. URL encoding
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
HopHopHipHip
1 month, 2 weeks ago
Selected Answer: B
The code shown is vulnerable to SQL injection, as it directly concatenates user input (Request("ItemID")) into a SQL query. This allows attackers to manipulate the input to execute arbitrary SQL commands. Query parameterization (also known as prepared statements) is the best defense against SQL injection. It ensures that user input is treated strictly as data, not executable SQL code.
upvoted 2 times
...
vicbersong
2 months ago
Selected Answer: B
Query parameterization involves using placeholders in SQL statements, so user input is treated strictly as data, not as executable code. Prevents attackers from injecting malicious SQL code.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...