99designs / 99designs/http-signatures-php

Use hash_equals instead of double HMAC approach for signature comparison

Offen
#29 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
PHP
Sterne
46
Forks
35
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

See https://github.com/99designs/http-signatures-php/pull/28 for what prompted this.

We're currently using a double HMAC approach for signature comparison, as that was the only way for us to securely compare HMAC signatures without making it a breaking change, as the [hash_equals](https://secure.php.net/hash_equals) function we need isn't available until PHP 5.7, and we support PHP 5.5+

When we roll out our next major version we should increase the minimum PHP version to 5.7 or higher, and swap to using `hash_equals`.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Look for signature comparison code in the codebase, likely in a class handling HMAC verification. Replace the double HMAC comparison with hash_equals. Check the PHP version requirement in composer.json to ensure it's 5.7+. Run existing tests to verify the change doesn't break functionality.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
php
Bereich
security
Issue-Typ
Refactoring
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

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