Skip to content
Path traversal Advisory Beginner CVE-2024-31450

GHSL-2023-277: Arbitrary File Deletion (AFD) in Owncast - CVE-2024-31450

The Owncast admin API endpoint for deleting custom emojis takes a name parameter and appends it directly to a file path without sanitisation. An attacker with admin credentials could use path traversal sequences to delete arbitrary files on the server.

ghsecuritylab Follow

Originally disclosed on GitHub Security Lab

Owncast in version 0.1.2 allows remote attackers with administrator privileges to delete arbitrary files by making a malicious POST request to /api/admin/emoji/delete.

ghsecuritylab, on GitHub Security Lab

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The application directly appends the user-controlled 'name' parameter to a file path without validating that it stays within the intended directory.

Impact

An attacker with admin privileges could delete arbitrary files on the system, potentially causing data loss or disruption.

What the attacker needed

Admin credentials

The fix

The vulnerability was fixed by validating the file path to ensure it stays within the intended directory.

How it was found

  1. Send a POST request to the /api/admin/emoji/delete endpoint with admin credentials.
  2. Include a JSON body with a 'name' field containing path traversal sequences.
  3. The server joins the name to the emoji directory path and deletes the resulting 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 report has not been written yet. The Original tab links to the source.

This is a path traversal bug. The server builds a file path by joining a fixed folder with a user-supplied name, but it does not check that the name stays inside that folder. By putting '../' in the name, an attacker can make the server delete files outside the intended folder, but only if they already have admin access.

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 ghsecuritylab

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

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.