fix(cognito): reject self-managed verification status (#2532)

This commit is contained in:
Daniel Zwicker authored and GitHub committed 2026-08-25 23:05:29 -05:00
1 parent 2e8cbc13d7
commit f8597bdef9
2 files changed
+42 -1

No files matched your search

@@ -1734,7 +1734,17 @@ public class CognitoService implements ResourceProvider {
validateOriginJtiNotRevoked(accessToken, poolId);
Long iat = extractIatFromToken(accessToken);
validateUserNotGloballySignedOut(username, poolId, "access", iat != null ? iat : 0L);
String verificationStatusAttribute = attributes.containsKey("email_verified")
? "email_verified"
: attributes.containsKey("phone_number_verified") ? "phone_number_verified" : null;
if (verificationStatusAttribute != null) {
throw new AwsException("InvalidParameterException",
"Invalid user attributes: " + verificationStatusAttribute
+ ": Attribute cannot be updated.",
400);
}
adminUpdateUserAttributes(poolId, username, attributes);
}