How occamsec/cve-2023-2825 works
Project Type and Purpose
• This is a small, single-script proof-of-concept (PoC) tool written in Python.
• Its sole purpose is to demonstrate CVE-2023-2825 (an unauthenticated path-traversal file-read vulnerability in GitLab CE/EE 16.0.0).
• It automates: login → group creation → project creation → file upload → exploit (arbitrary file read).
High-Level Analysis of File Structure
• Top Level
– README.md: describes vulnerability and PoC workflow
– poc.py: the Python script implementing the logic
– DISCLAIMER.txt: legal notice
• No subdirectories or configuration files—everything is in one script.
• External dependencies (implied): Python standard library + “requests” (or similar HTTP client).
Key Components to Model
a. POC Client (poc.py)
• Modules/Logical Layers inside the script:
• CLI / Orchestrator
• Auth module (POST /session)
• GroupCreation module (POST /groups)
• ProjectCreation module (POST /projects)
• FileUpload module (POST /:repo/upload)
• Exploit module (GET path-traversal URL)
• HTTP client library (e.g. requests)
b. External System: GitLab Server
• Nginx (front-end proxy)
• Rails app (GitLab Rails)
• Database (PostgreSQL)
• File storage (uploads directory on disk)
c. Network / HTTP Layer
• TLS/HTTP between POC and GitLab
Relationships and Interactions
• The POC script initiates an HTTPS connection to GitLab.
• Sequence:
1) Authenticate → session cookie/token
2) Create nested groups (x11)
3) Create project under nested groups
4) Upload benign file → returns upload URL
5) Exploit via GET with encoded “../” steps → GitLab Rails decodes and serves arbitrary file from disk
• Each step issues an HTTP request; responses drive the next step.
Architectural Patterns & Principles
• Single-process, linear orchestration (pipeline)
• Clear separation of concerns: each stage in PoC is a logical module
• Stateless interactions: every HTTP call has all needed context
• External system integration via REST API
Detailed Steps
– Auth
– GroupCreation
– ProjectCreation
– FileUpload
– Exploit
– Nginx (proxy)
– GitLab Rails App
4. Rails reading from the Uploads Dir when serving the exploit GET.
5. “N+1 group nesting → path-traversal depth” requirement near the GroupCreation module.