You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when the RenameUpload filter is added to a field containing the UploadFile validator the UploadFile validator fails and issues an error about a possible attack
the reason for that is that inside the UploadFile a check is performed using the tmp_name to check if the file was uploaded by using the method is_uploaded_file. as the RenameUpload filter is applied before calling the validator the tmp_name has been already changed based on the configuration for the RenameUpload filter and so the check fails as tmp_name is no longer the name to the uploaded file in the $_FILES array
Current behavior
impossible to upload a file when the RenameUpload filter and the UploadFile validator are used on the same field
How to reproduce
configure a field like this (using array notation for configuring a field):
Please open new issue report on laminas-inputfilter and add a full code example which allows to reproduce the problem or create a pull request with a unit test which illustrates the problem.
Bug Report
Summary
when the
RenameUpload
filter is added to a field containing theUploadFile
validator theUploadFile
validator fails and issues an error about a possible attackthe reason for that is that inside the
UploadFile
a check is performed using thetmp_name
to check if the file was uploaded by using the methodis_uploaded_file
. as theRenameUpload
filter is applied before calling the validator thetmp_name
has been already changed based on the configuration for theRenameUpload
filter and so the check fails astmp_name
is no longer the name to the uploaded file in the$_FILES
arrayCurrent behavior
impossible to upload a file when the
RenameUpload
filter and theUploadFile
validator are used on the same fieldHow to reproduce
configure a field like this (using array notation for configuring a field):
Expected behavior
the filter and validator can be used together
The text was updated successfully, but these errors were encountered: