Skip to content
Path traversal Write-up Intermediate

Shopping for an admin account via path traversal

The customers.gitlab.com portal built a URL for a PUT request to gitlab.com's API using a user-controlled namespace ID without sanitisation, allowing path traversal and query parameter injection. An attacker could use this to reach other API endpoints and inject attributes, such as promoting a regular account to admin.

about.gitlab.com

Published on about.gitlab.com

securitysecurity research

The author, on about.gitlab.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application concatenated a user-controlled path segment into a URL without validation, and the downstream API merged query parameters into the request body, allowing privilege escalation.

Impact

An attacker could promote a regular account to admin on gitlab.com, but the exploit was demonstrated only on the staging environment.

What the attacker needed

A GitLab Bronze subscription or purchased CI minutes; ability to change linked group or buy CI minutes

How it was found

  1. Use the 'Change linked Group' feature for a GitLab Bronze subscription to supply a crafted namespace ID.
  2. The crafted namespace ID contains a path traversal sequence and a query parameter to set admin=true.
  3. The portal sends a PUT request to the gitlab.com API with the admin token, reaching the users endpoint and setting admin=true.
  4. The targeted account is promoted to admin.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The customers portal took a value from the user (the namespace ID) and put it directly into a web address for an internal API call. Because it didn't check the value, an attacker could use special characters to change which API endpoint was called and add extra parameters. This let them trick the API into making their account an administrator.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.