CVE-2022-25757CWE-20

Apache APISIX: the body_schema check in request-validation plugin can be bypassed

published March 28, 2022

CVSS
—
EPSS
2%
Percentile
84.5
In the wild
Unconfirmed
What it is

⚠️ A sneaky JSON trick allows attackers to bypass critical validation! With duplicate keys, they can pull a fast one, hiding bad input behind good. 🔥 Think of it like a restaurant where the chef decides only to read the last order for a dish, ignoring the earlier ones — if someone orders a 'good' dish after a 'bad' one, the kitchen might serve the less appetizing option without knowing! In this scenario, an attacker could send a JSON payload that contains a harmful input disguised as a duplicate key, effectively undermining the request-validation plugin's ability to filter out bad data. This could lead to unauthorized actions or data manipulation in upstream applications, making your systems vulnerable. Yikes!

Put simply

Think of it like a restaurant where the chef decides only to read the last order for a dish, ignoring the earlier ones — if someone orders a 'good' dish after a 'bad' one, the kitchen might serve the less appetizing option without knowing! This vulnerability occurs in Apache APISIX versions before 2.13.0, where the lua-cjson library decodes JSON with duplicate keys by selecting the last value. This means that if the validation plugin relies on this behavior, malicious payloads can slip through undetected.

What to do

In this scenario, an attacker could send a JSON payload that contains a harmful input disguised as a duplicate key, effectively undermining the request-validation plugin's ability to filter out bad data. This could lead to unauthorized actions or data manipulation in upstream applications, making your systems vulnerable. Yikes! To mitigate this issue, upgrade Apache APISIX to version 2.13.0 or later. Additionally, ensure that your applications validate input independently, even if the body_schema validation plugin is in use. Regularly audit and test JSON handling practices to ensure robustness! You’ve got this! With these steps, you’ll lock down your systems and keep those sneaky inputs at bay. 🛡️

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.02481 · 84.5th percentile
Weakness
CWE-20 · Improper Input Validation
Published
2022-03-28T07:00Z
EPSS history
Timeline
  • 28 MAR 07:00Z
    Apache APISIX: the body_schema check in request-validation plugin can be bypassed
    cvelistv5