google-oauth-java-client improperly verifies cryptographic signature
Discription

Summary The vulnerability impacts only users of the IdTokenVerifier class. The verify method in IdTokenVerifier does not validate the signature before verifying the claims (e.g., iss, aud, etc.). Signature verification makes sure that the token's payload comes from valid provider, not from someone else. An attacker can provide a compromised token with modified payload like email or phone number. The token will pass the validation by the library. Once verified, modified payload can be used by the application. If the application sends verified IdToken to other service as is like for auth – the risk is low, because the backend of the service is expected to check the signature and fail the request. Reporter: Tamjid al Rahat, contributor Patches The issue was fixed in the 1.33.3 version of the library Proof of Concept To reproduce, one needs to call the verify function with an IdToken instance that contains a malformed signature to successfully bypass the checks inside the verify function. “` /* A default http transport factory for testing / static class DefaultHttpTransportFactory implements HttpTransportFactory { public HttpTransport create() { return new NetHttpTransport(); } } // The below token has some modified bits in the signature private static final String SERVICE_ACCOUNT_RS256_TOKEN_BAD_SIGNATURE = "eyJhbGciOiJSUzI1NiIsImtpZCI6IjJlZjc3YjM4YTFiMDM3MDQ4NzA0MzkxNmFjYmYyN2Q3NG" +…Read More

Back to Main

Subscribe for the latest news: