Prevent injection of invalid entity ids for "autocomplete" fields
Impact
Under certain circumstances, an attacker could successfully submit an entity id for an EntityType that is not part of the valid choices.
Source excerpt · OSVImpact
Under certain circumstances, an attacker could successfully submit an entity id for an EntityType that is not part of the valid choices.
Affected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
| Affected range | Recorded fix |
|---|---|
| Earlier releases before 2.11.2Ecosystem versions | 2.11.2 |
Version evidence: OSV · GHSA-4cpv-669c-r79x
View original version evidence (15 explicit versions)
Original source description
Impact
Under certain circumstances, an attacker could successfully submit an entity id for an EntityType that is not part of the valid choices.
Affected applications are any that use:
- A custom
query_builderoption to limit the valid results; AND - An
EntityTypewith'autocomplete' => trueor a custom AsEntityAutocompleteField.
Under this circumstance, if an id is submitted, it is accepted even if the matching record would not be returned by the custom query built with query_builder.
Patches
The problem has been fixed in symfony/ux-autocomplete version 2.11.2.
Workarounds
Upgrade to version 2.11.2 or greater of symfony/ux-autocomplete or perform extra validation after submit to verify the selected option is valid.
References
- Security advisory github.com/symfony/ux-autocomplete/security/advisories/GHSA-4cpv-669c-r79x
- Security advisory nvd.nist.gov/vuln/detail/CVE-2023-41336
- Patch github.com/symfony/ux-autocomplete/commit/fabcb2eee14b9e84a45b276711853a560b5d770c
- Security advisory github.com/FriendsOfPHP/security-advisories/blob/master/symfony/ux-autocomplete/CVE-2023-41336.yaml
- Source reference github.com/symfony/ux-autocomplete
- Source reference symfony.com/bundles/ux-autocomplete/current/index.html