Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid argument supplied for foreach() in firebase/php-jwt/src/JWT.php:422 #2243

Closed
bstanleynep opened this issue Apr 14, 2022 · 4 comments
Closed
Labels
triage me I really want to be triaged.

Comments

@bstanleynep
Copy link

Pull request #2235 updated this package's composer.json file to allow firebase/php-jwt v6.

firebase/php-jwt v6 changed the method signatures for both JWT::encode() and JWT::decode(). It seems that the calls in this library to this method were not updated accordingly.

From the firebase/php-jwt change log

The second argument of JWT::decode now must be Firebase\JWT\Key or array<string, Firebase\JWT\Key> (see firebase/php-jwt#376)
JWT::encode requires third argument $alg (see firebase/php-jwt#376)

The offending decode call is in src/AccessToken/Verify.php(106): Firebase\\JWT\\JWT::decode()

I will follow up this issue with a PR.

Environment details

  • OS: Ubuntu 20.04
  • PHP version: 7.4.28
  • Package name and version: 2.12.2
@bstanleynep bstanleynep mentioned this issue Apr 14, 2022
@alansory
Copy link

please review this pr

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Apr 15, 2022
@johnrobertcobbold
Copy link

johnrobertcobbold commented Apr 16, 2022

+1

@slaci
Copy link

slaci commented Apr 16, 2022

Seems like composer require firebase/php-jwt:^5.5.1 "fixes" this critical bug meanwhile.

@bshaffer
Copy link
Contributor

Fixed in v2.12.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

6 participants