How PwC found a zero-day vulnerability during a penetration test for a client (CVE-2021-21234)
An unauthenticated directory traversal vulnerability in the spring-boot-actuator-logview library allowed reading arbitrary files on the server via the base parameter of the /log/view endpoint. An attacker could access sensitive files such as /etc/passwd or environment variables, potentially exposing secrets and data sources.
blogg.pwc.no
Published on blogg.pwc.no
As the world grows increasingly interconnected, leveraging third parties is becoming increasingly important to achieve necessary agility. It’s not necessary to reinvent the wheel; software developers often focus their time on adding value rather than finding new ways to do old tricks.
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
The base parameter of the log-view endpoint was not sanitised for directory traversal sequences, unlike the filename parameter.
Impact
An attacker could read arbitrary files on the server, potentially accessing sensitive data sources and environment variables, though this is not remote code execution.
What the attacker needed
Access to the /log endpoint; vulnerable library version <= 0.2.12
The fix
The library was fixed in version 0.2.13; as a temporary mitigation, access to the /log endpoint can be restricted.
How it was found
- Reconnaissance revealed a /log endpoint for viewing log files.
- Selecting a log file led to a URL with filename and base parameters.
- Injecting ../ into the filename parameter failed due to sanitisation.
- Injecting ../ into the base parameter produced a 'no file provider found' error, indicating traversal.
- Requesting /etc/passwd via the base parameter confirmed arbitrary file read.
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 flaw lets someone use special characters like '../' to escape the folder they are supposed to be restricted to and read other files on the computer. Here, a log-viewing feature failed to properly check one of its inputs, so an attacker could ask for files outside the log folder, such as system password files or configuration secrets.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.