`Utils::validateHmac` fails if the query params contains non url-safe characters.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- php
- Ambito
- authentication, security
Direzione di ricerca
Inizia da Utils::validateHmac e riproduci il callback OAuth con uno state contenente caratteri codificati come Base64 o JSON. Traccia come vengono gestiti i parametri di query del callback prima della validazione HMAC; il lavoro è completato quando la validazione restituisce true per un URL correttamente firmato che contiene quei caratteri.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Issue summary
Utils::validateHmac fails if the query params contains non url-safe characters. For example, for a oauth authorization callback, if the state is a base64-encoded string, the trailing = character will make the HMAC validation fail. After talking with the Shopify support, I was told that the HMAC sent from Shopify is computed based on the original query params, instead of the URL-encoded version.
Expected behavior
HMAC validation should still work if the HMAC comes for a URL containing encoded characters
Actual behavior
Utils::validateHmac returns false, even if I can manually confirm that the HMAC is correct
Steps to reproduce the problem
- Initiate an OAuth autorization request. For the
state, use non url-safe characters (i.e. JSON, Base64, or colons:). In my case, I use an app I'm developping, and requesting access for that app to a test shop. - When the autorization request is accepted, the user is redirected to your
redirect_uriwith the resulting query parameters. Save those for next step - use
Utils::validateHmacto validate the callback. It will fail if thestateindeed contains encoded characters.
Reduced test case
The best way to get your bug fixed is to provide a reduced test case.
Checklist
- I have described this issue in a way that is actionable (if possible)
- Lingua principale
- PHP
- Stelle
- 473
- Fork
- 193
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Do not throw `WordPress.Security.EscapeOutput.OutputNotEscaped` on `apply_shortcodes()`Forse già presa @tbradsha l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
fe: spell out "Auto increment" in the table editor, "AI" reads as artificial intelligence todayAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
landsman/adminer-desktop#120 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
components-web-app/docs#227 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100