Skip to content
Path traversal Write-up Intermediate

CVE-2023-2825 Analysis And Exploit

GitLab version 16.0.0 fails to sanitise the file path in attachment URLs, allowing path traversal. An unauthenticated attacker can read arbitrary files on the server when a public project is nested within at least five groups.

OccamSec Follow

Published on occamsec.com

On May 23, 2023 GitLab released version 16.0.1 which fixed a critical vulnerability, CVE-2023-2825, affecting the Community Edition (CE) and Enterprise Edition (EE) version 16.0.0. The vulnerability allows unauthenticated users to read arbitrary files through a path traversal bug.

OccamSec (@occamsec), on occamsec.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

Impact

An unauthenticated attacker could read arbitrary files on the server, but only if a public project is nested within at least five groups.

What the attacker needed

GitLab version 16.0.0; Public project nested in at least 5 groups; An attachment exists in the project

The fix

GitLab released version 16.0.1 which fixed the vulnerability.

How it was found

  1. Create 11 nested groups.
  2. Create a public repository inside the innermost group.
  3. Upload a file as an attachment to an issue in that repository.
  4. Replace the file name in the attachment URL with a URL-encoded path traversal sequence pointing to the target file.
  5. Send a GET request to the modified URL to retrieve the file.

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.

A path traversal bug lets someone trick a web server into reading files outside the folder it should only serve. Here, GitLab did not clean up the file name in a download link, so an attacker could use '..' to climb up the folder tree and read sensitive files like the system password file.

What is Path traversal?

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

More by OccamSec

View all

1 more disclosed report, best first.

More from GitLab

View all

The newest disclosed reports for this program.

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.