Question:Consider the following code:
What potential security hole would this code snippet produce?
<?php
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)
}
/* .... */
?>
A Cross-Site Scripting Attack
B There is no security hole in this code
C Code Injection
D SQL Injection
E Choose 1 answer
+ AnswerB
+ Report