The vulnerability exists in the OpenIDImplicitGrant and OpenIDHybridGrant classes within the authlib library. Specifically, the validate_authorization_request methods in both grants perform a check for the 'openid' scope before validating the redirect_uri provided in the authorization request. If the 'openid' scope is missing, the code raises an InvalidScopeError and includes the unvalidated redirect_uri from the request. The OAuth2Error handling mechanism then constructs a 302 redirect response to this unvalidated URI, resulting in an open redirect. An attacker can exploit this by crafting a request that omits the 'openid' scope and provides a malicious redirect_uri, causing the authorization server to redirect the user to an attacker-controlled site. The patch corrects this by ensuring that the redirect_uri is validated before the scope check is performed, so that any subsequent error-related redirects use a trusted URI.