Skip to content

Commit 673cc5b

Browse files
committed
security fixes
1 parent 3efed0e commit 673cc5b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/OEmbed.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ private static function isXML(UriInterface $uri): bool
136136
private function extractXML(string $xml): array
137137
{
138138
try {
139+
// Remove the DOCTYPE declaration for to prevent XML Quadratic Blowup vulnerability
140+
$xml = preg_replace('/^<!DOCTYPE[^>]*+>/i', '', $xml, 1);
139141
$data = [];
140142
$errors = libxml_use_internal_errors(true);
141143
$content = new SimpleXMLElement($xml);

tests/fixtures/i.imgur.com.x6rkcc5.jpg.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'favicon' => 'https://i.imgur.com/favicon.ico',
1616
'feeds' => [],
1717
'icon' => null,
18-
'image' => 'http://i.imgur.com/X6rkCc5.jpg',
18+
'image' => 'https://i.imgur.com/X6rkCc5.jpg',
1919
'keywords' => [],
2020
'language' => null,
2121
'languages' => [],

0 commit comments

Comments
 (0)