A Look At Cve 2015 6967
The Nibbleblog 'My Image' plugin did not validate the file extension of uploaded files, so an authenticated admin could upload a PHP script and execute commands on the server. The attacker could then run arbitrary system commands through the uploaded web shell.
As promised in my previous blog post, in this post, I’ll take a look at CVE-2015–6967, a file upload vulnerability affecting Nibbleblog version 4.0.3, and write a custom script to exploit it.
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 upload handler took the file extension from the user-supplied filename and saved the file without checking that it was an allowed image type.
Impact
An attacker with admin access could execute arbitrary commands on the server, leading to remote code execution.
What the attacker needed
Admin privileges on the blog
The fix
The vulnerability was fixed by adding a check that only allows jpg, gif, or png file extensions before uploading.
How it was found
- Log in to Nibbleblog with admin privileges.
- Use the 'My Image' plugin to upload a file named with a .php extension.
- Access the uploaded file at the predictable plugin path.
- Pass a command through the GET parameter named 'c' to execute it via the system function.
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 blog plugin let an admin upload a file but never checked what type of file it was. Because the server ran PHP files, an attacker with admin access could upload a PHP script and then ask the server to run commands through it. This is called remote code execution: the attacker can run their own commands on the server.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.