The remote D-Link router is affected by a remote code execution vulnerability. D-Link DIR-820L 1.05B03 was discovered to contain a remote command execution (RCE) vulnerability via the Device Name parameter in /lan.asp.
Note that Nessus has not tested for this issue but has instead relied only on the router’s self-reported model.
#%NASL_MIN_LEVEL 80900
##
# (C) Tenable, Inc.
##
include('compat.inc');
if (description)
{
script_id(172029);
script_version("1.2");
script_set_attribute(attribute:"plugin_modification_date", value:"2023/08/09");
script_cve_id("CVE-2022-26258");
script_xref(name:"CISA-KNOWN-EXPLOITED", value:"2022/09/29");
script_name(english:"D-Link Routers Unauthenticated RCE (CVE-2022-26258)");
script_set_attribute(attribute:"synopsis", value:
"The remote router is affected by a remote code execution vulnerability.");
script_set_attribute(attribute:"description", value:
"The remote D-Link router is affected by a remote code execution vulnerability. D-Link DIR-820L 1.05B03 was discovered
to contain a remote command execution (RCE) vulnerability via the Device Name parameter in /lan.asp.
Note that Nessus has not tested for this issue but has instead relied only on the router's self-reported model.");
script_set_attribute(attribute:"see_also", value:"https://unit42.paloaltonetworks.com/moobot-d-link-devices/");
script_set_attribute(attribute:"solution", value:
"Upgrade to a supported device.");
script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C");
script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H");
script_set_cvss3_temporal_vector("CVSS:3.0/E:H/RL:O/RC:C");
script_set_attribute(attribute:"cvss_score_source", value:"CVE-2022-26258");
script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
script_set_attribute(attribute:"exploit_available", value:"true");
script_set_attribute(attribute:"vuln_publication_date", value:"2022/04/04");
script_set_attribute(attribute:"patch_publication_date", value:"2022/04/04");
script_set_attribute(attribute:"plugin_publication_date", value:"2023/03/01");
script_set_attribute(attribute:"plugin_type", value:"remote");
script_end_attributes();
script_category(ACT_GATHER_INFO);
script_family(english:"CGI abuses");
script_copyright(english:"This script is Copyright (C) 2023 Tenable Network Security, Inc.");
script_dependencies("d-link_router_detect.nasl");
script_require_keys("www/d-link", "d-link/model");
script_require_ports("Services/www", 80);
exit(0);
}
include('http.inc');
var model = toupper(get_kb_item_or_exit('d-link/model'));
# DIR-820L is EOL https://supportannouncement.us.dlink.com/announcement/publication.aspx?name=SAP10295
# Flag all of these models since version detection not guaranteed
if (model !~ "^DIR-820L$")
audit(AUDIT_HOST_NOT, 'an affected D-Link model');
var port = get_http_port(default:80, embedded:1);
var items = make_array('Model', model, 'Solution', 'Upgrade to a supported device');
var order = make_list('Model', 'Solution');
var report = report_items_str(report_items:items, ordered_fields:order);
security_report_v4(port:port, severity:SECURITY_HOLE, extra:report);