Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file-upload vulnerability in data/inc/files.php #72

Closed
Dk0n9 opened this issue Apr 9, 2019 · 4 comments
Closed

file-upload vulnerability in data/inc/files.php #72

Dk0n9 opened this issue Apr 9, 2019 · 4 comments

Comments

@Dk0n9
Copy link

Dk0n9 commented Apr 9, 2019

Location: https://github.com/pluck-cms/pluck/blob/master/data/inc/files.php#L40

Code:

<?php
	// ......
	$blockedExtentions = array('.php','php3','php4','php5','php6','php7','phtml');
			if (in_array($lastfour, $blockedExtentions) or in_array($lastfive, $blockedExtentions) ){
				if (!rename('files/'.latinOnlyInput($_FILES['filefile']['name']), 'files/'.latinOnlyInput($_FILES['filefile']['name']).'.txt')){
					show_error($lang['general']['upload_failed'], 1);
				}
				chmod('files/'.latinOnlyInput($_FILES['filefile']['name']).'.txt', 0775);
			}else{
				chmod('files/'.latinOnlyInput($_FILES['filefile']['name']), 0775);
			}
	// ......
?>

When the uploaded file hits the suffix in $blockedExtentions, the file will be renamed to .{ext}.txt, and missed $blockedExtentions will not be renamed. So you can upload a webshell by overriding the .htaccess file.

Step1. Upload a file .htaccess

File content:

image

Step2. Upload file phpinfo.txt

File content:

image

Step3. Request

getshell

@Dk0n9
Copy link
Author

Dk0n9 commented Apr 25, 2019

image

This was assigned CVE-2019-11344.

Credit: dk from Chaitin Tech

@BSteelooper
Copy link
Contributor

BSteelooper commented May 7, 2019

pluck-4.7.9-dev2.tar.gz
Can you try the latest checkout?

@BSteelooper
Copy link
Contributor

I classified this as an invalid. This is not a security concern. With the password there are easier ways to deface or take-over the website.
The inclusion of the .htaccess is a server setting to have this allowed or not. In my setup SetHandler is never allowed from .htaccess and only from the vhost.

@BSteelooper
Copy link
Contributor

Fixed it in this latest release
pluck-4.7.9-dev3.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants