Headline
CVE-2015-10056: fixed SQL injection vuln in unsanitized search input · 2071174A/vinylmap@b07b79a
A vulnerability was found in 2071174A vinylmap. It has been classified as critical. Affected is the function contact of the file recordstoreapp/views.py. The manipulation leads to sql injection. The name of the patch is b07b79a1e92cc62574ba0492cce000ef4a7bd25f. It is recommended to apply a patch to fix this issue. The identifier of this vulnerability is VDB-218400.
@@ -24,12 +24,14 @@ def contact(request):
def search(request): context_dict = {} if ‘q’ in request.GET and request.GET[‘q’] != '’: q = request.GET[‘q’] q = request.GET[‘q’].replace('%’, ‘’).replace('_’, ‘’).strip() if ‘q’ in request.GET and q != ‘’: q = ‘%’ + q + ‘%’ cursor = connection.cursor() cursor.execute(“SELECT id,title,artist,cover FROM recordstoreapp_record WHERE title like '%” + q + "%’ or artist like ‘%" + q + "%’ or label like ‘%" + q + "%’ or cat_no like '%" + q + “%’;”) cursor.execute("SELECT id,title,artist,cover FROM recordstoreapp_record WHERE title like %s or artist like %s or label like %s or cat_no like %s;", [q,q,q,q]) rec_list=cursor.fetchall()
total=len(rec_list) pg=int(request.GET[‘page’]) if ‘page’ in request.GET else 1 ub=min(pg*12, total)