-
Notifications
You must be signed in to change notification settings - Fork 9.4k
fix adminhtml file attribute edit form #11267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fixes magento#11252 not sure why this line was introduced as the only place this function is used seems to be here: https://github.com/magento/magento2/blob/55e9a5cc9d88ef785f39217e96da02b1cdf3e247/app/code/Magento/Customer/Model/FileUploader.php#L110 and it uses 'path' key right after call.
@@ -181,7 +181,6 @@ public function saveTemporaryFile($fileId) | |||
); | |||
|
|||
$result = $uploader->save($path); | |||
unset($result['path']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was added for security reasons: https://github.com/magento/magento2/blame/2.2-develop/app/code/Magento/Customer/Model/FileProcessor.php#L184
Please figure out another way to fix bug you faced with.
Hi @orlangur, Maybe I am missing something but only place in CE and EE I am seeing that is using this function is this place:
And it is using 'path' right after and If I see correctly it is using it to create file path to validate it later. So it needs this data. Path can be unset after that (in FileUploader::upload()) but without knowing what the security issue was I can only guess, Is MAGETWO-70580 an internal ticket number? Can we know exactly what issue this change fixed? cheers. |
So, basically, initial security fix needs to be revised which was reverted by changes in this PR and the correct way of fix needs to be understood. Unassigning from myself for now, will check it again when I have some spare time. |
Hi, @fsw. After debugging I found that |
Hi @omiroshnichenko, by "remove usage of $result['path']" do you mean to remove pointed line at all or to change it to something like this:
If I recall correctly when I did this and uploaded file via admin form it indeed broke saying tmp_name is undefined or something like that but I can't recall exactly. So I think it is indeed used for some validation. Anyway I added you as collaborator so please feel free to do whatever you like with this PR or create a new one. cheers. |
d3b7655
to
f63d74c
Compare
fixes #11252
Description
not sure why this line was introduced as the only place this function is used seems to be here:
magento2/app/code/Magento/Customer/Model/FileUploader.php
Line 110 in 55e9a5c
and it uses 'path' key right after call.
hence no tests are included.
Fixed Issues (if relevant)
Manual testing scenarios