simplesamlphp / simplesamlphp/simplesamlphp-module-radius

RADIUS authentication is retried at secondary server even if first server returned Auth Failure

Offen
#35 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
PHP
Sterne
2
Forks
2
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

We have configured two RADIUS servers for failover. Recently, I noticed that failed authentications from the primary are immediately re-asked at the secondary server (which still generates and Auth failure, so the end result is consistent and no harm done).

But there's really no point in asking the failover server if the primary is sure that the auth failed.

Looking at the code, I found a logic error here:

https://github.com/simplesamlphp/simplesamlphp-module-radius/blob/27d7591603dd2665a147857a4f8adcd33eb6d6cf/src/Auth/Source/Radius.php#L167

The code considers the RADIUS query successful only if it returns not-false.

The underlying library returns sth not-false only in case the authentication succeeded. Notably, a failed authentication is as "false" as a protocol error. See the return paths of its function: they are either outright "false" or compare whether the authentication was a success:

https://github.com/dapphp/radius/blob/master/src/Radius.php#L1752

I.e. error conditions and a negative outcome both have the same result; and the calling module in SSP will loop over all configured servers in both cases. Only a positive result breaks out of the loop.

Ideally, a confirmed negative result from the primary authentication server should be taken as-is.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit src/Auth/Source/Radius.php bei ungefähr Zeile 167 und untersuchen Sie die referenzierten Rückgabepfade in dapphp/radius's src/Radius.php bei ungefähr Zeile 1752. Bestätigen Sie, wie Authentifizierungsfehler und Protokollfehler dargestellt werden, und fügen Sie anschließend Tests hinzu, die zeigen, dass eine bestätigte primäre Ablehnung nicht erneut versucht wird, während ein Fehler weiterhin ein Failover auslösen kann.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
php
Bereich
authentication, backend
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.