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

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-27 11:34:54 +00:00
parent a37895a16a
commit f1202bea08
226 changed files with 1952 additions and 450 deletions

View file

@ -56,6 +56,11 @@ class OidcClient
if (! is_string($document[$field] ?? null) || $document[$field] === '') {
throw new IdentityException("Das Discovery-Dokument des Anmeldedienstes enthält kein „{$field}“.");
}
// Schlüssel und Tokens nur über HTTPS – sonst ließen sie sich unterwegs austauschen
if (! self::secureUrl($document[$field])) {
throw new IdentityException("„{$field}“ des Anmeldedienstes muss mit https:// beginnen.");
}
}
// Der Aussteller muss exakt der konfigurierten Adresse entsprechen (OIDC Discovery 4.3).
@ -233,4 +238,11 @@ class OidcClient
{
return Http::timeout(15)->connectTimeout(5)->acceptJson();
}
/** https – nur auf dem eigenen Rechner (Entwicklung) auch http */
public static function secureUrl(string $url): bool
{
return str_starts_with(strtolower($url), 'https://')
|| (app()->environment('local', 'testing') && preg_match('#^http://(localhost|127\.0\.0\.1)(:\d+)?(/|$)#i', $url));
}
}

View file

@ -51,6 +51,7 @@ class OidcDriver extends IdentityDriver
{
return [
TextInput::make('config.issuer')->label('Aussteller (Issuer-URL)')->required()->url()->maxLength(255)
->rule(fn () => fn (string $attribute, mixed $value, \Closure $fail) => OidcClient::secureUrl((string) $value) ? null : $fail('Bitte eine https://-Adresse angeben.'))
->placeholder('https://login.firma.de/realms/mitarbeitende')
->helperText('Die Adresse, unter der /.well-known/openid-configuration liegt.')
->columnSpanFull(),
@ -75,6 +76,11 @@ class OidcDriver extends IdentityDriver
return ['client_secret'];
}
public function destinationFields(): array
{
return ['issuer'];
}
public function defaultAttributeMap(): array
{
return ['first_name' => 'given_name', 'last_name' => 'family_name', 'email' => 'email'];
@ -172,6 +178,9 @@ class OidcDriver extends IdentityDriver
'email' => 'email',
]);
// Hat der Anbieter die Adresse bestätigt? (für das Verknüpfen bestehender Konten)
$profile['email_verified'] = in_array($claims['email_verified'] ?? null, [true, 'true'], true);
return new ExternalUser(
subject: $subject,
profile: $profile,