]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
[CVE-2024-48916] rgw/sts: fix to disallow unsupported JWT algorithms 62046/head
authorPritha Srivastava <prsrivas@redhat.com>
Tue, 5 Nov 2024 06:33:00 +0000 (12:03 +0530)
committerPritha Srivastava <prsrivas@redhat.com>
Fri, 28 Feb 2025 04:35:14 +0000 (10:05 +0530)
while authenticating AssumeRoleWithWebIdentity using JWT obtained
from an external IDP.

fixes: https://tracker.ceph.com/issues/68836

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
(cherry picked from commit 919da3696668a07c6810dfa39301950c81c2eba4)

src/rgw/rgw_rest_sts.cc

index 09f77f61d5f6134d4f9fdb7afd795e007bf22138..23328236ab9845ed2a87f633afa034d099b8e857 100644 (file)
@@ -444,6 +444,9 @@ WebTokenEngine::validate_signature(const DoutPrefixProvider* dpp, const jwt::dec
                               .allow_algorithm(jwt::algorithm::ps512{cert});
 
                 verifier.verify(decoded);
+              } else {
+                ldpp_dout(dpp, 0) << "Unsupported algorithm: " << algorithm << dendl;
+                throw -EINVAL;
               }
             } catch (std::runtime_error& e) {
               ldpp_dout(dpp, 0) << "Signature validation failed: " << e.what() << dendl;