Improper Access Control Affecting io.micronaut.security:micronaut-security-oauth2 package, versions [,3.1)[3.1.0,3.1.2)[3.2.0,3.2.4)[3.3.0,3.3.2)[3.4.0,3.4.3)[3.5.0,3.5.3)[3.6.0,3.6.6)[3.7.0,3.7.4)[3.8.0,3.8.4)[3.9.0,3.9.6)[3.10.0,3.10.2)[3.11.0,3.11.1)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.05% (24th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Improper Access Control vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JAVA-IOMICRONAUTSECURITY-5950375
  • published8 Oct 2023
  • disclosed5 Oct 2023
  • credittommyli

Introduced: 5 Oct 2023

CVE-2023-36820  (opens in a new tab)
CWE-284  (opens in a new tab)

How to fix?

Upgrade io.micronaut.security:micronaut-security-oauth2 to version 3.1, 3.1.2, 3.2.4, 3.3.2, 3.4.3, 3.5.3, 3.6.6, 3.7.4, 3.8.4, 3.9.6, 3.10.2, 3.11.1 or higher.

Overview

Affected versions of this package are vulnerable to Improper Access Control due to the IdTokenClaimsValidator logic on aud. An attacker can bypass aud claim validation if the token is issued by the same identity issuer/provider, leading to potential unauthorized access by exploiting the logic flaw.

Workaround

This vulnerability can be mitigated by setting micronaut.security.token.jwt.claims-validators.audience with valid values. micronaut.security.token.jwt.claims-validators.openid-idtoken can be kept as default on.

PoC

                return issuer.equalsIgnoreCase(iss) &&
                        audiences.contains(clientId) &&
                                validateAzp(claims, clientId, audiences);

CVSS Scores

version 3.1