{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2022-25757","id":"CVE-2022-25757","title":"Apache APISIX: the body_schema check in request-validation plugin can be bypassed","description":"In Apache APISIX before 2.13.0, 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. For example, `{\"string_payload\":\"bad\",\"string_payload\":\"good\"}` can be used to hide the \"bad\" input. Systems satisfy three conditions below ar","descriptionLong":"In Apache APISIX before 2.13.0, 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. For example, `{\"string_payload\":\"bad\",\"string_payload\":\"good\"}` can be used to hide the \"bad\" input. 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. The fix in APISIX is to re-encode the validated JSON input back into the request body at the side of APISIX. Improper Input Validation vulnerability in __COMPONENT__ of Apache APISIX allows an attacker to __IMPACT__. This issue affects Apache APISIX Apache APISIX version 2.12.1 and prior versions.","published":"2022-03-28T07:00:16.000Z","updated":"2026-10-28T02:30:27.367199383Z","reserved":"2022-02-22T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"apache","metric":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"critical","source":"NVD"},"metrics":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"critical","source":"NVD"},{"version":"2.0","score":6.8,"vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","rating":"medium","source":"NVD"}],"rating":"critical","products":["Apache Software Foundation Apache APISIX"],"affectedProducts":[{"vendor":"Apache Software Foundation","product":"Apache APISIX","defaultStatus":null,"versions":[{"lessThanOrEqual":"2.12.1","status":"affected","version":"Apache APISIX","versionType":"custom"}],"platforms":[]}],"packages":[],"cwes":["CWE-20"],"aliases":["BIT-apisix-2022-25757"],"references":[{"url":"https://lists.apache.org/thread/03vd2j81krxmpz6xo8p1dl642flpo6fv","tags":["x_refsource_MISC","x_transferred","Mailing List","Vendor Advisory","web"]},{"url":"http://www.openwall.com/lists/oss-security/2022/03/28/2","tags":["mailing-list","x_refsource_MLIST","x_transferred","Mailing List","Third Party Advisory","article"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/25xxx/CVE-2022-25757.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-25757","tags":["advisory"]}],"patchReferenced":false,"fixAvailable":false,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.02481,"epssPercentile":0.84929,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2022-25757","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-25757","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2022-25757","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2022-25757","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}