Skip to content
Path traversal Write-up Intermediate

Security Advisory

The Spring Cloud Config Server's endpoint for serving plain-text files did not properly validate the requested path, allowing directory traversal. An attacker could read arbitrary files on the server, such as /etc/passwd.

chybeta.github.io

Published on chybeta.github.io

https://pivotal.io/security/cve-2019-3799

The author, on chybeta.github.io

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 server concatenated the user-supplied path onto a base directory without checking for '..' sequences, so the resulting file path could point outside the intended folder.

What the attacker needed

Access to the config server endpoint

How it was found

  1. Send a request to the config server's plain-text endpoint with a path containing encoded '..' sequences.
  2. The server dispatches the request to ResourceController and calls retrieve and findOne.
  3. The path is joined to the temporary config repository location, producing a path outside that folder.
  4. The server reads the file and returns its contents.

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 directory traversal bug lets someone use '..' in a file path to escape the intended folder and read other files on the server. Here, the config server was supposed to serve only files from a temporary repository folder, but it accepted a path that climbed out of that folder. This meant an attacker could read sensitive system files like the 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.

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.