Skip to content

Commit 26f760b

Browse files
authored
Merge pull request #307 from bigcommerce/PHPMNT-347-fix-firebase-php-jwt
fix: PHPMNT-347 allow firebase/php-jwt ^7.0 to fix CVE-2025-45769
2 parents 513c3d0 + 1b6c264 commit 26f760b

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
],
2020
"require": {
2121
"php": ">=8.1",
22-
"firebase/php-jwt": "~5.0 || ~6.0",
22+
"firebase/php-jwt": "~5.0 || ~6.0 || ^7.0",
2323
"ext-curl": "*"
2424
},
2525
"require-dev": {

test/Unit/Api/ClientTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ public function testGetLastErrorGetsErrorFromConnection()
103103

104104
public function testGetCustomerLoginTokenReturnsValidLoginToken()
105105
{
106-
Client::configureOAuth(['client_id' => '123', 'auth_token' => 'def', 'store_hash' => 'abc', 'client_secret' => 'zyx']);
106+
$clientSecret = 'zyx-test-secret-key-that-is-long-enough-for-hs256';
107+
Client::configureOAuth(['client_id' => '123', 'auth_token' => 'def', 'store_hash' => 'abc', 'client_secret' => $clientSecret]);
107108
$expectedPayload = ['iss' => '123', 'operation' => 'customer_login', 'store_hash' => 'abc', 'customer_id' => 1];
108109
$token = Client::getCustomerLoginToken(1);
109-
$key = new \Firebase\JWT\Key('zyx', 'HS256');
110+
$key = new \Firebase\JWT\Key($clientSecret, 'HS256');
110111
$actualPayload = (array)\Firebase\JWT\JWT::decode($token, $key);
111112
foreach ($expectedPayload as $value) {
112113
$this->assertContains($value, $actualPayload);

0 commit comments

Comments
 (0)