Description
Symfony version(s) affected
5.4.7, 6.0.7, 6.1
Description
There is hardcoded array of keys for $_FILES in https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Form/NativeRequestHandler.php.
It is checked against posted data in two cases:
https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Form/NativeRequestHandler.php#L204
https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Form/NativeRequestHandler.php#L240
In PHP 8.1 was added new key full_path (https://php.watch/versions/8.1/$_FILES-full-path). As a result check is broken and we get incorrect format of image's array at https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Form/NativeRequestHandler.php#L93 and error that form contains not allowed extra fields.
How to reproduce
We use Form component as standalone without entire framework but within our cms. Problem looks obvious, but if it will be needed, I'll try to create code for reproduce problem.
Possible Solution
I've found that such problem was already fixed in HttpFoundation component: #42112
Additional Context
No response