exam questions

Exam CAS-004 All Questions

View all questions & answers for the CAS-004 exam

Exam CAS-004 topic 1 question 637 discussion

Actual exam question from CompTIA's CAS-004
Question #: 637
Topic #: 1
[All CAS-004 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
Bright07
2 months ago
Selected Answer: B
The most appropriate recommendation for the security architect is: B. Query parameterization. The code shown is vulnerable to SQL Injection because user input (Request("ItemID")) is being directly concatenated into the SQL query. This creates a potential security risk where an attacker could manipulate the ItemID input to inject malicious SQL code, leading to unauthorized data access, modification, or deletion. Query parameterization (also known as prepared statements) is a secure way to handle user input in SQL queries. It ensures that user input is treated as data, not executable code, preventing SQL injection attacks. Instead of concatenating input into the query, parameterized queries bind user input to predefined placeholders, making it impossible for attackers to alter the query structure.
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago