Skip to content

Commit d646dc1

Browse files
author
Yaroslav Onischenko
committed
MAGETWO-37209: Excel Formula Injection via CSV/XML export - 2.x
1 parent f44c65d commit d646dc1

File tree

3 files changed

+5
-4
lines changed
  • app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite
  • lib/internal/Magento/Framework/Filesystem

3 files changed

+5
-4
lines changed

app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ define([
77
"jquery/ui",
88
"mage/translate",
99
"prototype",
10-
'Magento_Ui/js/modal/modal'
10+
"Magento_Ui/js/modal/modal",
11+
"domReady!"
1112
], function(jQuery){
1213

1314
window.ProductConfigure = Class.create();
@@ -764,4 +765,4 @@ define([
764765
};
765766

766767
productConfigure = new ProductConfigure();
767-
});
768+
});

lib/internal/Magento/Framework/Filesystem/Driver/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ public function filePutCsv($resource, array $data, $delimiter = ',', $enclosure
710710
if (!is_string($value)) {
711711
$value = (string)$value;
712712
}
713-
if (isset($value[0]) && $value[0] === '=') {
713+
if (isset($value[0]) && in_array($value[0], ['=', '+', '-'])) {
714714
$data[$key] = ' ' . $value;
715715
}
716716
}

lib/internal/Magento/Framework/Filesystem/Io/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function streamWriteCsv(array $row, $delimiter = ',', $enclosure = '"')
190190
if (!is_string($value)) {
191191
$value = (string)$value;
192192
}
193-
if (isset($value[0]) && $value[0] === '=') {
193+
if (isset($value[0]) && in_array($value[0], ['=', '+', '-'])) {
194194
$row[$key] = ' ' . $value;
195195
}
196196
}

0 commit comments

Comments
 (0)