<<< Previous question <<< Question ID#0523.md >>> Next question >>>
Consider the following code:
session_start();
if(!empty($_REQUEST['id']) && !empty($_REQUEST['quantity'])) {
$id = scrub_id($_REQUEST['id']);
$quantity = scrub_quantity($_REQUEST['quantity'])
$_SESSION['cart'][] = array('id' => $id, 'quantity' => $quantity)
}
/* .... */
What potential security hole would this code snippet produce?
- A) There is no security hole in this code
- B) Cross-Site Scripting Attack
- C) Code Injection
- D) SQL Injection
Answer
Answer: A