Sicherheitsupdate nach Audit (0.29.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m50s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 7m34s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m45s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m30s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m7s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 7m9s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m8s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 6m5s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 48s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m5s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m50s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 7m34s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m45s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m30s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m7s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 7m9s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m8s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 6m5s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 48s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m5s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a37895a16a
commit
f1202bea08
226 changed files with 1952 additions and 450 deletions
|
|
@ -3,6 +3,7 @@
|
|||
namespace Inhaus\Plugins\WordpressImport;
|
||||
|
||||
use App\Support\Images;
|
||||
use App\Support\SafeOutbound;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
|
@ -65,12 +66,26 @@ class MediaDownloader
|
|||
return $known;
|
||||
}
|
||||
|
||||
// Keine internen Adressen abrufen (die URLs stammen aus der hochgeladenen Exportdatei)
|
||||
if (! SafeOutbound::isPublicUrl($url)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$tmp = tempnam(sys_get_temp_dir(), 'wpimg');
|
||||
|
||||
try {
|
||||
$response = Http::timeout(20)->connectTimeout(10)->get($url);
|
||||
// Beim Überschreiten der Größe schon während des Ladens abbrechen
|
||||
$response = Http::timeout(20)->connectTimeout(10)->withOptions([
|
||||
...SafeOutbound::options(),
|
||||
'progress' => function ($total, $downloaded) {
|
||||
if ($total > self::MAX_BYTES || $downloaded > self::MAX_BYTES) {
|
||||
throw new \RuntimeException('Datei zu groß');
|
||||
}
|
||||
},
|
||||
])->get($url);
|
||||
$mime = strtolower(explode(';', (string) $response->header('Content-Type'))[0]);
|
||||
$extension = ['image/jpeg' => 'jpg', 'image/png' => 'png', 'image/gif' => 'gif', 'image/webp' => 'webp'][$mime] ?? null;
|
||||
|
||||
$body = $response->successful() ? $response->body() : '';
|
||||
|
||||
if (! $extension || $body === '' || strlen($body) > self::MAX_BYTES) {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ class WxrReader
|
|||
{
|
||||
$reader = new XMLReader;
|
||||
|
||||
// Keine eigenen Entitäten (Schutz vor „Billion Laughs“ – WordPress-Exporte nutzen keine)
|
||||
if (str_contains((string) @file_get_contents($file, false, null, 0, 65536), '<!ENTITY')) {
|
||||
throw new RuntimeException('Die Datei enthält nicht unterstützte XML-Entitäten.');
|
||||
}
|
||||
|
||||
if (! @$reader->open($file, null, LIBXML_NONET | LIBXML_COMPACT | LIBXML_PARSEHUGE)) {
|
||||
throw new RuntimeException('Die Datei konnte nicht gelesen werden.');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue