VYPR
Medium severityNVD Advisory· Published Jan 6, 2025· Updated Apr 15, 2026

CVE-2025-21617

CVE-2025-21617

Description

Guzzle OAuth Subscriber signs Guzzle requests using OAuth 1.0. Prior to 0.8.1, Nonce generation does not use sufficient entropy nor a cryptographically secure pseudorandom source. This can leave servers vulnerable to replay attacks when TLS is not used. This vulnerability is fixed in 0.8.1.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
guzzlehttp/oauth-subscriberPackagist
< 0.8.10.8.1

Patches

1
92b619b03bd2

Release 0.8.1

https://github.com/guzzle/oauth-subscriberGraham CampbellJan 6, 2025via ghsa
2 files changed · +8 21
  • CHANGELOG.md+4 0 modified
    @@ -1,5 +1,9 @@
     # CHANGELOG
     
    +## 0.8.1 - 2025-06-01
    +
    +* Fixed insufficient nonce entropy (CVE-2025-21617)
    +
     ## 0.8.0 - 2025-06-01
     
     * Adjusted some method modifiers and added return types
    
  • src/Oauth1.php+4 21 modified
    @@ -100,10 +100,7 @@ public function __invoke(callable $handler)
          */
         private function onBefore(RequestInterface $request): RequestInterface
         {
    -        $oauthparams = self::getOauthParams(
    -            $this->generateNonce($request),
    -            $this->config
    -        );
    +        $oauthparams = self::getOauthParams($this->config);
     
             $oauthparams['oauth_signature'] = $this->getSignature($request, $oauthparams);
             uksort($oauthparams, 'strcmp');
    @@ -179,19 +176,6 @@ public function getSignature(RequestInterface $request, array $params): string
             return base64_encode($signature);
         }
     
    -    /**
    -     * Returns a Nonce Based on the unique id and URL.
    -     *
    -     * This will allow for multiple requests in parallel with the same exact
    -     * timestamp to use separate nonce's.
    -     *
    -     * @param RequestInterface $request Request to generate a nonce for
    -     */
    -    private static function generateNonce(RequestInterface $request): string
    -    {
    -        return sha1(uniqid('', true).$request->getUri()->getHost().$request->getUri()->getPath());
    -    }
    -
         /**
          * Creates the Signature Base String.
          *
    @@ -296,14 +280,13 @@ private function buildAuthorizationHeader(array $params): array
         /**
          * Get the oauth parameters as named by the oauth spec
          *
    -     * @param string $nonce  Unique nonce
    -     * @param array  $config Configuration options of the plugin.
    +     * @param array $config Configuration options of the plugin.
          */
    -    private static function getOauthParams(string $nonce, array $config): array
    +    private static function getOauthParams(array $config): array
         {
             $params = [
                 'oauth_consumer_key' => $config['consumer_key'],
    -            'oauth_nonce' => $nonce,
    +            'oauth_nonce' => bin2hex(random_bytes(20)),
                 'oauth_signature_method' => $config['signature_method'],
                 'oauth_timestamp' => time(),
             ];
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.