-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SECURITY] Mitigate phar stream wrapper
SoftReferenceIndex throws exceptions on phar streams LegacyLinkNotationConverter throws exceptions on phar streams Resolves: #85385 Releases: master, 8.7, 7.6 Security-Commit: f11da6bc371729fd8ab556af8e2b84c9f8501704 Security-Bulletin: TYPO3-CORE-SA-2018-002 Change-Id: Iad230e9a0fe876b879eac810b6fa14b6d9f4fcdb Reviewed-on: https://review.typo3.org/57545 Reviewed-by: Oliver Hader <oliver.hader@typo3.org> Tested-by: Oliver Hader <oliver.hader@typo3.org>
- Loading branch information
Showing
4 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
namespace TYPO3\CMS\Core\Tests\Unit\Database; | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
use TYPO3\CMS\Core\Database\SoftReferenceIndex; | ||
use TYPO3\TestingFramework\Core\Unit\UnitTestCase; | ||
|
||
/** | ||
* Test case | ||
*/ | ||
class SoftReferenceIndexTest extends UnitTestCase | ||
{ | ||
/** | ||
* @return array | ||
*/ | ||
public function getTypoLinkPartsThrowExceptionWithPharReferencesDataProvider(): array | ||
{ | ||
return [ | ||
'URL encoded local' => [ | ||
'phar%3a//some-file.jpg', | ||
], | ||
'URL encoded absolute' => [ | ||
'phar%3a///path/some-file.jpg', | ||
], | ||
'not URL encoded local' => [ | ||
'phar://some-file.jpg', | ||
], | ||
'not URL encoded absolute' => [ | ||
'phar:///path/some-file.jpg', | ||
], | ||
]; | ||
} | ||
|
||
/** | ||
* @test | ||
* @dataProvider getTypoLinkPartsThrowExceptionWithPharReferencesDataProvider | ||
*/ | ||
public function getTypoLinkPartsThrowExceptionWithPharReferences(string $pharUrl) | ||
{ | ||
$this->expectException(\RuntimeException::class); | ||
$this->expectExceptionCode(1530030672); | ||
(new SoftReferenceIndex())->getTypoLinkParts($pharUrl); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters