Closed Luciferiix closed 5 years ago
@Luciferiix Thank you for reporting. We have created an internal task for this report and will try to review as soon as possible. Internal reference: PLGMAGTWOS-376
Analysis Impact is not severe for the following reasons:
Proposal
About the impact i would be that shure. But i'm not that good at Triage.
The problem is not in the locking of files. Sanitising has to be done after getting the parameter value. It's a "thing" from the internet, please sanitise it first before try to fix a side effect somewhere else.
$params = $this->_requestHttp->getParams();
$this->_mspHelper->lockProcess('multisafepay-' . $params['transactionid']);
Don't worry this is a hard one. a 'normal' %00 (null) byte will throw exception, but as you can see we can get rid of the trailing ".lock". https://www.owasp.org/index.php/OWASP_Periodic_Table_of_Vulnerabilities_-_Null_Byte_Injection
The safest solution is in the controller at the source of the evil. (the internet)
$transactionId = $this->_requestHttp->getParams('transactionid');
$this->helper->validateTransactionId($transactionId); // Throws a SecurityException
We have released 1.7.0 which solves this issue.
Missing input sanitization and relying that i can't escape before passing on to Magento\Framework\Filesystem\Directory\WriteInterface in: https://github.com/MultiSafepay/Magento2Msp/blob/master/Controller/Fastcheckout/Success.php#L97
Name is: 'multisafepay-{{{{no-body-really-cares-apperently}}}}' Like: abc/../../../someFileThatNeedsToBeThere{{{{fancy-hacking-stuff-to-escape-the-suffix})}}
If i can point to a relative old existing file here your going to delete it:
Conclusion: Is your Transaction key a number of fixed length ? Or does it have a subset a characters ?
Please check this first before passing it on to function in the namespace "Framework". They can't expect un-sanitised inputs.