CVSS2
Attack Vector
NETWORK
Attack Complexity
MEDIUM
Authentication
NONE
Confidentiality Impact
PARTIAL
Integrity Impact
PARTIAL
Availability Impact
PARTIAL
AV:N/AC:M/Au:N/C:P/I:P/A:P
CVSS3
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality Impact
HIGH
Integrity Impact
HIGH
Availability Impact
HIGH
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
Percentile
74.1%
The version of Apache APISIX installed on the remote host is prior to 2.13.0. It is, therefore, potentially affected by an input validation vulnerability. When decoding JSON with duplicate keys, lua-cjson will choose the last occurred value as the result. By passing a JSON with a duplicate key, the attacker can bypass the body_schema validation in the request-validation plugin. Systems satisfy three conditions below are affected by this attack: 1. use body_schema validation in the request-validation plugin 2. upstream application uses a special JSON library that chooses the first occurred value, like jsoniter or gojay 3. upstream application does not validate the input anymore.
Note that Nessus has not tested for these issues but has instead relied only on the application’s self-reported version number.
##
# (C) Tenable, Inc.
##
include('compat.inc');
if (description)
{
script_id(161977);
script_version("1.2");
script_set_attribute(attribute:"plugin_modification_date", value:"2022/06/13");
script_cve_id("CVE-2022-25757");
script_name(english:"Apache APISIX < 2.13.0 Input Validation");
script_set_attribute(attribute:"synopsis", value:
"An application installed on the remote host is missing a vendor-supplied update.");
script_set_attribute(attribute:"description", value:
"The version of Apache APISIX installed on the remote host is prior to 2.13.0. It is, therefore, potentially affected
by an input validation vulnerability. When decoding JSON with duplicate keys, lua-cjson will choose the last occurred
value as the result. By passing a JSON with a duplicate key, the attacker can bypass the body_schema validation in the
request-validation plugin. Systems satisfy three conditions below are affected by this attack: 1. use body_schema
validation in the request-validation plugin 2. upstream application uses a special JSON library that chooses the first
occurred value, like jsoniter or gojay 3. upstream application does not validate the input anymore.
Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version
number.");
script_set_attribute(attribute:"see_also", value:"https://github.com/apache/apisix/blob/release/2.13/CHANGELOG.md#2130");
script_set_attribute(attribute:"see_also", value:"https://lists.apache.org/thread/03vd2j81krxmpz6xo8p1dl642flpo6fv");
script_set_attribute(attribute:"solution", value:
"Upgrade to Apache APISIX version 2.13.0 or later.");
script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
script_set_cvss_temporal_vector("CVSS2#E:U/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:U/RL:O/RC:C");
script_set_attribute(attribute:"cvss_score_source", value:"CVE-2022-25757");
script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
script_set_attribute(attribute:"vuln_publication_date", value:"2022/03/28");
script_set_attribute(attribute:"patch_publication_date", value:"2022/03/28");
script_set_attribute(attribute:"plugin_publication_date", value:"2022/06/09");
script_set_attribute(attribute:"potential_vulnerability", value:"true");
script_set_attribute(attribute:"plugin_type", value:"remote");
script_set_attribute(attribute:"cpe", value:"cpe:/a:apache:apisix");
script_end_attributes();
script_category(ACT_GATHER_INFO);
script_family(english:"Misc.");
script_copyright(english:"This script is Copyright (C) 2022 and is owned by Tenable, Inc. or an Affiliate thereof.");
script_dependencies("apache_apisix_http_detect.nbin");
script_require_keys("installed_sw/Apache APISIX", "Settings/ParanoidReport");
exit(0);
}
include('http.inc');
include('vcf.inc');
var port = get_http_port(default:9080);
var app_info = vcf::get_app_info(app:'Apache APISIX', port:port, service:TRUE);
# Not able to check for patch, mitigation, or plugin
if (report_paranoia < 2)
audit(AUDIT_PARANOID);
var constraints = [
{'fixed_version': '2.13.0'}
];
vcf::check_version_and_report(
app_info:app_info,
constraints:constraints,
severity:SECURITY_WARNING
);
CVSS2
Attack Vector
NETWORK
Attack Complexity
MEDIUM
Authentication
NONE
Confidentiality Impact
PARTIAL
Integrity Impact
PARTIAL
Availability Impact
PARTIAL
AV:N/AC:M/Au:N/C:P/I:P/A:P
CVSS3
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality Impact
HIGH
Integrity Impact
HIGH
Availability Impact
HIGH
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
Percentile
74.1%