🇰🇷 한글 설명
Lemonldap::NG::Portal의 특정 버전에서 GitHub 및 LinkedIn 백엔드 사용 시 OAuth2 state 파라미터가 SSO 세션으로 저장되어 인증을 우회할 수 있는 취약점이 발견되었습니다. 공격자는 탈취한 state 식별자를 세션 쿠키로 재사용하여 인증 없이 유효한 SSO 세션을 획득할 수 있습니다. 이는 기본 설정에서 가상 호스트에 'default => accept' 규칙이 적용된 경우 매우 위험합니다.
💡 쉬운 설명
로그인 과정에서 생성되는 임시 번호가 실제 로그인된 상태로 잘못 인식되는 보안 결함입니다. 해커가 이 번호를 가로채서 마치 로그인을 성공한 것처럼 속여 시스템에 접속할 수 있습니다.
🇺🇸 원문 (English)
Lemonldap::NG::Portal versions from 2.0.0 before 2.16.9, from 2.17.0 before 2.21.5, from 2.22.0 before 2.23.3 for Perl allow authentication bypass via an OAuth2 state parameter stored as an SSO session in the GitHub and LinkedIn backends.
Before redirecting to the identity provider, extractFormInfo() creates the state session with the positional call `getApacheSession( undef, 1, 0, 'GitHubState' )`. getApacheSession() takes a session id followed by a named argument hash, so the trailing arguments become that hash, `kind` defaults to SSO, and the state is written to the global session storage as a regular SSO session. Its identifier is handed to the unauthenticated visitor as the state parameter of the redirection URL.
Any visitor who reaches the GitHub or LinkedIn endpoint can replay that identifier as a session cookie and obtain a valid SSO session without authenticating. The session holds neither _user nor authenticationLevel, which the shipped bootstrap configuration accepts because it grants virtual hosts a "default => accept" access rule; deployments whose rules test the user or require an authentication level are less exposed. Only configurations with the GitHub or LinkedIn authentication module enabled are affected.
📍 영향받는 시스템
Lemonldap::NG::Portal 2.0.0 < 2.16.9, 2.17.0 < 2.21.5, 2.22.0 < 2.23.3
⚔️ 공격 벡터
GitHub 또는 LinkedIn 엔드포인트에서 탈취한 OAuth2 state 파라미터를 세션 쿠키로 재전송(Replay Attack)
🛡️ 대응 방법
Lemonldap::NG::Portal을 최신 버전(2.23.3 이상 등)으로 업데이트하고, 인증 규칙을 'default => accept'가 아닌 사용자/인증 레벨 검증 방식으로 변경하십시오.
🔧 검증 코드
출력된 버전 번호가 취약한 버전 범위(2.0.0~2.23.2 사이의 특정 구간)에 해당하는지 확인하십시오.
perl -MLemonldap::NG::Portal -e 'print $Lemonldap::NG::Portal::VERSION . "\n"' 2>/dev/null