Problem/Motivation
Security advisory:
composer audit
Found 1 security vulnerability advisory affecting 1 package:
+-------------------+----------------------------------------------------------------------------------+
| Package | firebase/php-jwt |
| CVE | CVE-2021-46743 |
| Title | Key/algorithm type confusion |
| URL | https://github.com/advisories/GHSA-8xf4-w7qw-pjjw |
| Affected versions | <6.0.0 |
| Reported at | 2022-03-30T00:00:00+00:00
where is jwt called:
html/modules/contrib/salesforce/modules/salesforce_jwt/composer.json: "firebase/php-jwt": "^5.0",
html/modules/contrib/salesforce/composer.json: "firebase/php-jwt": "^5.0",
html/modules/contrib/salesforce/composer.json: "firebase/php-jwt": "Required for salesforce_jwt, recommended auth provider.",
Steps to reproduce
composer audit
Proposed resolution
Update to a version of firebase/php-jwt > 6.0 or give explanation like http://drupal.org/project/jwt
Comments
Comment #3
aaronbaumanThank you for the report.
I discussed this with the security team, including pwolanin who confronted the same issue for https://www.drupal.org/project/jwt
tl;dr: the CVE for PHP-JWT does not affect Salesforce Suite
salesforce_jwt only calls
JWT::encode($token, $key, 'RS256')and neverJWT::decode()so it cannot possibly be vulnerable to the key confusion issue.See more info on the https://www.drupal.org/project/jwt project page.
Also, in the future, please follow security issue reporting protocol to report any potential security vulnerabilities.
Comment #4
bkosborneNote that version 5.x of firebase/jwt no longer seems supported, since the security vulnerability was addressed only in the 6.x branch of that project. However, it seems there's nothing preventing users of this module from updating to the 6.x branch. It's true that the composer.json file in the salesforce_jwt submodule lists 5.x as required, composer doesn't look at the composer.json files of submodules when resolving dependency requirements.
I think the Salesforce module should update to test and declare support of the 6.x branch of firebase/jwt, but from what I can tell that package's API is limited to one method call to encode a JWT. There don't appear to be any breaking changes from the 5.x > 6.x branch that would impact the way this module uses that API call.
Comment #5
inversed commentedAlso, in case anyone did not realize, now that the roave/security-advisories package is aware of this, it blocks a composer update if the installed firebase/php-jwt package is 5.x.
I didn't have any problems manually requiring firebase/php-jwt:6.0 and it looks like the salesforce:5.0.x-dev version has an updated composer.json to support 5.0 or 6.0 so I figure this issue will get resolved eventually.