CVE-2014-125081 (published 2023-01-17T23:15Z)

A vulnerability, which was classified as critical, has been found in risheesh debutsav. This issue affects some unknown processing. The manipulation leads to sql injection. The patch is named 7a8430df79277c613449262201cc792db894fc76. It is recommended to apply a patch to fix this issue. The associated identifier of this vulnerability is VDB-218459.

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/risheesh/debutsav
commit_details: repo_url: https://github.com/risheesh/debutsav
author: Tony Thomas
author_date: 2014-10-05 21:50:51+05:30
msg: Fixed sqli in sqlite3
repository: repo_url: https://github.com/risheesh/debutsav
repo_name: risheesh/debutsav
description: The debustav'14 website - www.debutsav.in
repo_language: CSS
owner: risheesh
file_changes: filename: delegateRegistration.php
change_type: ModificationType.MODIFY
diff: @@ -51,21 +51,21 @@ if ( $_SERVER["REQUEST_METHOD"] == "POST" ) {
 		$myDateTime = new DateTime( Date( '' ), new DateTimeZone( 'GMT' ) );
 		$myDateTime->setTimezone( new DateTimeZone( 'Asia/Kolkata' ) );
 		$date = $myDateTime->format( 'Y-m-d H:i:s' );
-		$name = $_POST['del-name'];
+		$name = SQLite3::escapeString($_POST['del-name']);
 		if ( empty( $_POST['del-email'] ) )
 		{
 			$emailerror = "Required Field";
 		}
 		else
 		{
-			$email = $_POST['del-email'];
+			$email = SQLite3::escapeString($_POST['del-email']);
 			if ( !preg_match( "/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email ) )
 			{
 				$emailerror = "Invalid Format";
 			}
 		}
-		$org = $_POST['del-org'];
-		$city = $_POST['del-city'];
+		$org = SQLite3::escapeString($_POST['del-org']);
+		$city = SQLite3::escapeString($_POST['del-city']);
 		if ( !preg_match( '/$^|^[a-zA-Z]+[0-9]*[\. ,]*[a-zA-Z0-9]*$/', $city ) )
 		{
 			$cityerror = "City name must start with a letter and can contain only alphanumerics, spaces, periods and commas";
@@ -76,23 +76,23 @@ if ( $_SERVER["REQUEST_METHOD"] == "POST" ) {
 			$arrivalerror = "No arriving date given";
 		} else {
 
-			$arrival = $_POST['del-arrival'];
+			$arrival = SQLite3::escapeString($_POST['del-arrival']);
 		}
 		if ( empty( $_POST['del-depart'] ) ) {
 			$departureerror = "No departure date given";
 		} else {
-			$departure = $_POST['del-depart'];
+			$departure = SQLite3::escapeString($_POST['del-depart']);
 		}
 		$lap = 1;
 		if ( empty( $_POST['del-accom'] ) ) {
 			$accom = "0";
 		} else {
-			$accom = $_POST['del-accom'];
+			$accom = SQLite3::escapeString($_POST['del-accom']);
 		}
 		if ( empty( $_POST['del-tshirt'] ) ) {
 			$tshirt = "0";
 		} else {
-			$tshirt = $_POST['del-tshirt'];
+			$tshirt = SQLite3::escapeString($_POST['del-tshirt']);
 		}
 
 		if ( $nameerror == "" && $emailerror == "" && $arrivalerror == "" && $departureerror == "" && $orgerror == "" && $cityerror == "" )

programming_language: PHP
filename: speakerRegistration.php
change_type: ModificationType.MODIFY
diff: @@ -1,6 +1,5 @@
 <?php
-error_reporting( E_ALL );
-ini_set( 'display_errors', '1' );
+error_reporting(0);
 # Database Connection
 class database extends SQLite3
 {
@@ -54,21 +53,21 @@ if ( $_SERVER["REQUEST_METHOD"] == "POST" ) {
 		$myDateTime = new DateTime( Date( '' ), new DateTimeZone( 'GMT' ) );
 		$myDateTime->setTimezone( new DateTimeZone( 'Asia/Kolkata' ) );
 		$date = $myDateTime->format( 'Y-m-d H:i:s' );
-		$name = $_POST['sp-name'];
+		$name = SQLite3::escapeString( $_POST['sp-name'] );
 		if ( empty( $_POST['sp-email'] ) )
 		{
 			$emailerror = "Required Field";
 		}
 		else
 		{
-			$email = $_POST['sp-email'];
+			$email = SQLite3::escapeString( $_POST['sp-email'] );
 			if ( !preg_match( "/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email ) )
 			{
 				$emailerror = "Invalid Format";
 			}
 		}
-		$org = $_POST['sp-org'];
-		$city = $_POST['sp-city'];
+		$org = SQLite3::escapeString( $_POST['sp-org'] );
+		$city = SQLite3::escapeString( $_POST['sp-city'] );
 		if ( !preg_match( '/$^|^[a-zA-Z]+[0-9]*[\. ,]*[a-zA-Z0-9]*$/', $city ) )
 		{
 			$cityerror = "City name must start with a letter and can contain only alphanumerics, spaces, periods and commas";
@@ -76,40 +75,40 @@ if ( $_SERVER["REQUEST_METHOD"] == "POST" ) {
 		if ( empty( $_POST['sp-profile'] ) ) {
 			$profilerror = "No profile";
 		} else {
-			$profile = $_POST['sp-profile'];
+			$profile = SQLite3::escapeString( $_POST['sp-profile'] );
 		}
 
 		if ( empty( $_POST['sp-tshirt'] ) ) {
 			$tshirt = "0";
 		} else {
-			$tshirt = $_POST['sp-tshirt'];
+			$tshirt = SQLite3::escapeString( $_POST['sp-tshirt'] );
 		}
 
 		if ( empty( $_POST['sp-arrival'] ) ) {
 			$arrivalerror = "No arriving date given";
 		} else {
-			$arrival = $_POST['sp-arrival'];
+			$arrival = SQLite3::escapeString( $_POST['sp-arrival'] );
 		}
 		if ( empty( $_POST['sp-depart'] ) ) {
 			$departureerror = "No departure date given";
 		} else {
-			$departure = $_POST['sp-depart'];
+			$departure = SQLite3::escapeString( $_POST['sp-depart'] );
 		}
 		$lap = 1;
 		if ( empty( $_POST['sp-accom'] ) ) {
 			$accom = "0";
 		} else {
-			$accom = $_POST['sp-accom'];
+			$accom = SQLite3::escapeString( $_POST['sp-accom'] );
 		}
-		$pretitle = $_POST['sp-title'];
+		$pretitle = SQLite3::escapeString( $_POST['sp-title'] );
 		if ( empty( $pretitle ) )
 		{
 			$titleerror = "Required Field";
 		}
 		else
 		{
-			$title = $_POST['sp-title'];
-			$desc = $_POST['sp-desc'];
+			$title = SQLite3::escapeString( $_POST['sp-title'] );
+			$desc = SQLite3::escapeString( $_POST['sp-desc'] );
 
 		}
 		if ( $nameerror == "" && $emailerror == "" && $arrivalerror == "" && $departureerror == "" && $orgerror == "" && $cityerror == "" && $titleerror == "" && $profilerror == "" )
@@ -123,11 +122,11 @@ if ( $_SERVER["REQUEST_METHOD"] == "POST" ) {
 				header( 'location:../../registration_success.html' );
 			} else {
 				echo "fail";
-//				header( 'location:../../registration_fail.html' );
+				header( 'location:../../registration_fail.html' );
 			}
 		} else {
 			echo "fail";
-//			header( 'location:../../registration_fail.html' );
+			header( 'location:../../registration_fail.html' );
 		}
 	}
 }

programming_language: PHP