ID OPENVAS:1361412562310108664 Type openvas Reporter Copyright (C) 2019 Greenbone Networks GmbH Modified 2020-06-04T00:00:00
Description
Greenbone Security Assistant (GSA) is prone to an HTTP host
header injection vulnerability.
# Copyright (C) 2019 Greenbone Networks GmbH
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
CPE = "cpe:/a:greenbone:greenbone_security_assistant";
if(description)
{
script_oid("1.3.6.1.4.1.25623.1.0.108664");
script_version("2020-06-04T11:48:22+0000");
script_tag(name:"last_modification", value:"2020-06-04 11:48:22 +0000 (Thu, 04 Jun 2020)");
script_tag(name:"creation_date", value:"2019-10-10 06:28:14 +0000 (Thu, 10 Oct 2019)");
script_tag(name:"cvss_base", value:"5.0");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:P/A:N");
script_tag(name:"qod_type", value:"remote_vul");
script_tag(name:"solution_type", value:"VendorFix");
script_name("Greenbone Security Assistant (GSA) < 7.0.3 Host Header Injection Vulnerability");
script_category(ACT_ATTACK);
script_copyright("Copyright (C) 2019 Greenbone Networks GmbH");
script_family("Web application abuses");
script_dependencies("gb_gsa_detect.nasl", "gb_greenbone_os_consolidation.nasl", "smtp_settings.nasl"); # nb: The setting for get_3rdparty_domain() is currently located in this VT.
script_mandatory_keys("greenbone_security_assistant/pre80/detected");
script_exclude_keys("greenbone/gos/detected");
script_tag(name:"summary", value:"Greenbone Security Assistant (GSA) is prone to an HTTP host
header injection vulnerability.");
script_tag(name:"impact", value:"An attacker can potentially use this vulnerability in a phishing attack.");
script_tag(name:"affected", value:"Greenbone Security Assistant (GSA) before version 7.0.3.");
script_tag(name:"solution", value:"Update to version 7.0.3 or later.");
script_tag(name:"vuldetect", value:"Sends a crafted HTTP GET request and checks the response.");
script_xref(name:"URL", value:"https://github.com/greenbone/gsa/pull/318");
script_xref(name:"URL", value:"https://github.com/greenbone/gsa/releases/tag/v7.0.3");
exit(0);
}
if (get_kb_item("greenbone/gos/detected")) # Covered by 2019/greenbone/gb_gos_host_header_vuln_active.nasl
exit(0);
include("host_details.inc");
include("http_func.inc");
include("http_keepalive.inc");
include("misc_func.inc");
include("smtp_func.inc");
if (!port = get_app_port(cpe: CPE, service: "www"))
exit(0);
if (!dir = get_app_location(cpe: CPE, port: port))
exit(0);
if (dir == "/")
dir = "";
domain = get_3rdparty_domain();
replace = "Host: " + domain;
url = dir + "/";
req = http_get(port: port, item: url);
req = ereg_replace(string: req, pattern: '(Host: [^\r\n]+)', replace: replace);
res = http_keepalive_send_recv(port: port, data: req);
if (!res || res !~ "^HTTP/1\.[01] 303")
exit(0);
if (found = egrep(string: res, pattern: '<html><body>Code 303 - Redirecting to .+' + domain + '.+<a/></body></html>', icase: TRUE)) {
info['HTTP Method'] = "GET";
info['URL'] = http_report_vuln_url(port: port, url: url, url_only: TRUE);
info['"Host" header'] = replace;
report = 'By doing the following request:\n\n';
report += text_format_table(array: info) + '\n\n';
report += 'it was possible to redirect to an external ';
report += 'domain via an HTTP Host header injection attack.';
report += '\n\nResult:\n\n' + chomp(found);
expert_info = 'Request:\n'+ req + 'Response:\n' + res + '\n';
security_message(port: port, data: report, expert_info: expert_info);
exit(0);
}
exit(99);
{"id": "OPENVAS:1361412562310108664", "type": "openvas", "bulletinFamily": "scanner", "title": "Greenbone Security Assistant (GSA) < 7.0.3 Host Header Injection Vulnerability", "description": "Greenbone Security Assistant (GSA) is prone to an HTTP host\n header injection vulnerability.", "published": "2019-10-10T00:00:00", "modified": "2020-06-04T00:00:00", "cvss": {"score": 0.0, "vector": "NONE"}, "href": "http://plugins.openvas.org/nasl.php?oid=1361412562310108664", "reporter": "Copyright (C) 2019 Greenbone Networks GmbH", "references": ["https://github.com/greenbone/gsa/pull/318", "https://github.com/greenbone/gsa/releases/tag/v7.0.3"], "cvelist": [], "lastseen": "2020-06-08T22:38:33", "viewCount": 28, "enchantments": {"dependencies": {"references": [], "modified": "2020-06-08T22:38:33", "rev": 2}, "score": {"value": -0.2, "vector": "NONE", "modified": "2020-06-08T22:38:33", "rev": 2}, "vulnersScore": -0.2}, "pluginID": "1361412562310108664", "sourceData": "# Copyright (C) 2019 Greenbone Networks GmbH\n#\n# SPDX-License-Identifier: GPL-2.0-or-later\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n\nCPE = \"cpe:/a:greenbone:greenbone_security_assistant\";\n\nif(description)\n{\n script_oid(\"1.3.6.1.4.1.25623.1.0.108664\");\n script_version(\"2020-06-04T11:48:22+0000\");\n script_tag(name:\"last_modification\", value:\"2020-06-04 11:48:22 +0000 (Thu, 04 Jun 2020)\");\n script_tag(name:\"creation_date\", value:\"2019-10-10 06:28:14 +0000 (Thu, 10 Oct 2019)\");\n script_tag(name:\"cvss_base\", value:\"5.0\");\n script_tag(name:\"cvss_base_vector\", value:\"AV:N/AC:L/Au:N/C:N/I:P/A:N\");\n\n script_tag(name:\"qod_type\", value:\"remote_vul\");\n\n script_tag(name:\"solution_type\", value:\"VendorFix\");\n\n script_name(\"Greenbone Security Assistant (GSA) < 7.0.3 Host Header Injection Vulnerability\");\n\n script_category(ACT_ATTACK);\n\n script_copyright(\"Copyright (C) 2019 Greenbone Networks GmbH\");\n script_family(\"Web application abuses\");\n script_dependencies(\"gb_gsa_detect.nasl\", \"gb_greenbone_os_consolidation.nasl\", \"smtp_settings.nasl\"); # nb: The setting for get_3rdparty_domain() is currently located in this VT.\n script_mandatory_keys(\"greenbone_security_assistant/pre80/detected\");\n script_exclude_keys(\"greenbone/gos/detected\");\n\n script_tag(name:\"summary\", value:\"Greenbone Security Assistant (GSA) is prone to an HTTP host\n header injection vulnerability.\");\n\n script_tag(name:\"impact\", value:\"An attacker can potentially use this vulnerability in a phishing attack.\");\n\n script_tag(name:\"affected\", value:\"Greenbone Security Assistant (GSA) before version 7.0.3.\");\n\n script_tag(name:\"solution\", value:\"Update to version 7.0.3 or later.\");\n\n script_tag(name:\"vuldetect\", value:\"Sends a crafted HTTP GET request and checks the response.\");\n\n script_xref(name:\"URL\", value:\"https://github.com/greenbone/gsa/pull/318\");\n script_xref(name:\"URL\", value:\"https://github.com/greenbone/gsa/releases/tag/v7.0.3\");\n\n exit(0);\n}\n\nif (get_kb_item(\"greenbone/gos/detected\")) # Covered by 2019/greenbone/gb_gos_host_header_vuln_active.nasl\n exit(0);\n\ninclude(\"host_details.inc\");\ninclude(\"http_func.inc\");\ninclude(\"http_keepalive.inc\");\ninclude(\"misc_func.inc\");\ninclude(\"smtp_func.inc\");\n\nif (!port = get_app_port(cpe: CPE, service: \"www\"))\n exit(0);\n\nif (!dir = get_app_location(cpe: CPE, port: port))\n exit(0);\n\nif (dir == \"/\")\n dir = \"\";\n\ndomain = get_3rdparty_domain();\nreplace = \"Host: \" + domain;\nurl = dir + \"/\";\n\nreq = http_get(port: port, item: url);\nreq = ereg_replace(string: req, pattern: '(Host: [^\\r\\n]+)', replace: replace);\nres = http_keepalive_send_recv(port: port, data: req);\nif (!res || res !~ \"^HTTP/1\\.[01] 303\")\n exit(0);\n\nif (found = egrep(string: res, pattern: '<html><body>Code 303 - Redirecting to .+' + domain + '.+<a/></body></html>', icase: TRUE)) {\n\n info['HTTP Method'] = \"GET\";\n info['URL'] = http_report_vuln_url(port: port, url: url, url_only: TRUE);\n info['\"Host\" header'] = replace;\n\n report = 'By doing the following request:\\n\\n';\n report += text_format_table(array: info) + '\\n\\n';\n report += 'it was possible to redirect to an external ';\n report += 'domain via an HTTP Host header injection attack.';\n report += '\\n\\nResult:\\n\\n' + chomp(found);\n\n expert_info = 'Request:\\n'+ req + 'Response:\\n' + res + '\\n';\n security_message(port: port, data: report, expert_info: expert_info);\n exit(0);\n}\n\nexit(99);\n", "naslFamily": "Web application abuses"}