The vulnerability exists in the oidc-claims-extension.groovy script, which allows an attacker to inject arbitrary values into OIDC claims. The root cause is the attributeRetriever closure within this script, which fails to validate user-provided claim values against the user's actual identity. The patch addresses this by comparing the requested claim value with the value retrieved from the user's identity and rejecting any mismatches.
The analysis of the patch file openam-scripting/src/main/groovy/oidc-claims-extension.groovy reveals the exact code change that fixes the vulnerability. The old code would accept any requested claim value if only one was provided. The new code validates the requested value against the user's identity.
Furthermore, a new log message introduced in the patch (logger.warning("OpenAMScopeValidator.getUserInfo(): ...")) strongly suggests that the org.forgerock.openam.oauth2.OpenAMScopeValidator.getUserInfo Java method is the entry point that executes the vulnerable Groovy script. Therefore, both the Groovy closure and the calling Java method are relevant for identifying the vulnerability in a runtime environment.