Miggo Logo

CVE-2023-6291: The redirect_uri validation logic allows for bypassing explicitly allowed hosts that would otherwise be restricted

7.1

CVSS Score
3.1

Basic Information

EPSS Score
0.42029%
Published
12/21/2023
Updated
1/26/2024
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
org.keycloak:keycloak-servicesmaven< 23.0.323.0.3

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from incomplete URI normalization in redirect validation. The commit b2e9110 explicitly fixes this by introducing stripOffRedirectForWildcard() to remove user-info, query, and fragment components before validation. The original matchesRedirects function (lines 256-257 in the patch) only handled query parameters, making it vulnerable to authority confusion via encoded user-info payloads like 'www%2ekeycloak%2eorg%2fapp%2f:y@example.com'. The function's failure to sanitize user-info before wildcard comparison directly enabled the validation bypass.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*n issu* w*s *oun* in t** r**ir**t_uri v*li**tion lo*i* t**t *llows *or * *yp*ss o* ot**rwis* *xpli*itly *llow** *osts. T** pro*l*m *ris*s in t** v*ri*yR**ir**tUri m*t*o*, w*i** *tt*mpts to *n*or** rul*s on us*r-*ontroll**l* input, *ut *ss*nti*lly *

Reasoning

T** vuln*r**ility st*ms *rom in*ompl*t* URI norm*liz*tion in r**ir**t v*li**tion. T** *ommit ******* *xpli*itly *ix*s t*is *y intro*u*in* `stripO**R**ir**t*orWil***r*()` to r*mov* us*r-in*o, qu*ry, *n* *r**m*nt *ompon*nts ***or* v*li**tion. T** ori*i