The vulnerability allows a user with a restricted application credential (e.g., read-only) to create EC2 credentials that have the full permissions of the parent user, effectively bypassing the restrictions of the application credential. This is because the EC2 credential creation API endpoint did not check if the application credential was restricted.
The patch addresses this by adding a check, _check_unrestricted_application_credential, to the post method of the UserOSEC2CredentialsResourceListCreate class in keystone/api/users.py. This ensures that only unrestricted application credentials can be used to create EC2 credentials. The change to keystone/common/policies/ec2_credential.py further tightens the policy for creating and deleting EC2 credentials, requiring a 'member' role, which prevents users with only a 'reader' role from performing these actions.