Laravel: Empty array key validation bypass
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| laravelframework | — | Not listed |
| composerlaravel/framework |
< 12.73.0→ 12.73.0 |
12.73.0 |
| Packagistlaravel/framework |
< 12.73.0→ 12.73.0 |
12.73.0 |
Original description The description as published by the source.
When validated input contains an array element whose key is an empty string, such as {"items": {"": {"name": "..."}}} in a JSON request, the rules attached to items.* are never applied to that element. ValidationRuleParser already matches empty segments with [^\.]*, but ValidationData::extractValuesForWildcards() and Validator::getExplicitKeys() still use [^\.]+, so the element is never gathered and wildcard parameters such as required_if:users.*.role,admin are not resolved for it. Rules like Rule::forEach() or array:name,qty on items.* are silently skipped for that element.
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com