CVE-2013-10011 (published 2023-01-12T16:15Z)

A vulnerability was found in aeharding classroom-engagement-system and classified as critical. Affected by this issue is some unknown functionality. The manipulation leads to sql injection. The attack may be launched remotely. The name of the patch is 096de5815c7b414e7339f3439522a446098fb73a. It is recommended to apply a patch to fix this issue. The identifier of this vulnerability is VDB-218156.

CVSS v3 base score: 9.8, CRITICAL (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-89
cwe_name: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
description: The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.
extended_description: 
            
            
         
         

Fix information:
repo_url: https://github.com/aeharding/classroom-engagement-system
commit_details: repo_url: https://github.com/aeharding/classroom-engagement-system
author: aeharding@gmail.com
author_date: 2013-03-21 04:35:50+00:00
msg: real_escape_string() to prevent SQL injections on database.
 Removed old welcomeEmail.php
repository: repo_url: https://github.com/aeharding/classroom-engagement-system
repo_name: aeharding/classroom-engagement-system
description: Automatically exported from code.google.com/p/classroom-engagement-system
repo_language: PHP
owner: aeharding
file_changes: filename: index.php
change_type: ModificationType.MODIFY
diff: @@ -14,13 +14,20 @@
 		$error = false;
 		$errorMsg = '';
 		
+		
 		if(strlen($student) > 4) {
+		
+			// Prevent SQL Injections
+			$session = $con->real_escape_string($session);
+			$student = $con->real_escape_string($student);
+			
 			$sql="SELECT count(1) FROM sessions WHERE s_sid='" . $session . "'";
 
 			if (!mysqli_query($con,$sql)) {
 				die('Error: ' . mysqli_error());
 			}
-			
+
+
 			$result = $con->query($sql);
 			$row = $result->fetch_array(MYSQLI_NUM);
 			$total = $row[0];

programming_language: PHP
filename: create.php
change_type: ModificationType.MODIFY
diff: @@ -1,7 +1,7 @@
 <?php
 	
 function checkID($con,$id_check) {
-	$id_check = $con->real_escape_string($id_check);
+	$id_check = $con->real_escape_string($id_check); // Prevent SQL Injections
 	$query = "SELECT * FROM sessions WHERE s_sid='" . $id_check . "'";
 	$result = $con->query($query);
 	if(count($result->fetch_array(MYSQLI_NUM)) > 0) {

programming_language: PHP
filename: welcome.php
change_type: ModificationType.MODIFY
diff: @@ -1,5 +1,5 @@
 <?php
-	/* ONLY USED BY CREATE.PHP, expects:
+	/* ONLY USED BY ../CREATE.PHP, expects:
 			1. $email: Email of user
 			2. $id:		 Class session name
 			3. $pass:  Specified password for $id

programming_language: PHP
filename: login.php
change_type: ModificationType.MODIFY
diff: @@ -15,6 +15,11 @@
 		
 		$session = $_POST['sid'];
 		$pass = $_POST['pass'];
+		
+		// Prevent SQL Injections
+		$session = $con->real_escape_string($session);
+		$pass = $con->real_escape_string($pass);
+
 
 		$sql="SELECT count(1) FROM sessions WHERE s_sid='" . $session . "' AND s_pass='" . $pass . "'";
 

programming_language: PHP
filename: welcomeEmail.php
change_type: ModificationType.DELETE
diff: @@ -1,17 +0,0 @@
-<?php
-	// Biiiggg TODO
-	include '../setup/connect.php';
-	$con = new mysqli($config_server, $config_user, $config_pass, $config_table);
-	$sql="SELECT count(1) FROM sessions WHERE s_sid='" . $session . "' AND s_pass='" . $pass . "'";
-	if (!mysqli_query($con,$sql)) {
-		die('Error: ' . mysqli_error());
-	}
-	
-	$result=$con->query($sql);
-	$row = $result->fetch_array(MYSQLI_NUM);
-	$total = $row[0];
-	if($total == 1) {
-	}
-
-
-?>
\ No newline at end of file

programming_language: unknown