Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 686 Bytes

0523.md

File metadata and controls

26 lines (22 loc) · 686 Bytes

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