-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
An vulnerability that can get a webshell #321
Comments
I think you can't do that.
But a better way is to add an .htaccess file in core/lib folder with this rule :
And now I have just an "403 error" |
Hello, |
Est-ce qu'utiliser la fonction title2filename ne résoudrait pas le problème ? $content['config_path'] = implode('/',array_map('plxUtils::title2filename',explode('/',$content['config_path']))); À placer après la ligne 129 # Si nouvel emplacement du dossier de configuration
if(isset($content['config_path'])) { |
Alors ??? |
I think this will work. example:
|
This issue seems to have been assigned CVE-2020-18185. |
Bonjour @jerrywham Merci |
Bonjour @NicoleG25 , Si vous souhaitez vous protéger de l'injection de code, vous pouvez modifier la méthode plxAdmin::editConfiguration() comme ceci vers la fin : # Si nouvel emplacement du dossier de configuration
if(isset($content['config_path'])) {
// $newpath=trim($content['config_path']);
$newpath = filter_var($content['config_path'], FILTER_SANITIZE_STRING);
if(
!empty($newpath) and
$newpath != PLX_CONFIG_PATH and
file_exists(PLX_ROOT . $newpath . basename(path('XMLFILE_PARAMETERS')))
) {
# relocalisation du dossier de configuration de PluXml
if(!rename(PLX_ROOT.PLX_CONFIG_PATH,PLX_ROOT.$newpath))
return plxMsg::Error(sprintf(L_WRITE_NOT_ACCESS, $newpath));
# mise à jour du fichier de configuration config.php
if(!plxUtils::write("<?php define('PLX_CONFIG_PATH', '".$newpath."') ?>", PLX_ROOT.'config.php'))
return plxMsg::Error(L_SAVE_ERR.' config.php');
} else {
return plxMsg::Error('What are you doing ?');
}
} Vous pouvez vous repérer par rapport au commentaire. Lee principe étant de vérifier l'accès au fichier parametres.xml avec le chemin $newpath. Pour avoir un niveau de sécurité encore plus élevé, il faut sortir le fichier config.php de l'arborescence du DocumentRoot du serveur HTTP. grep -n "'config.php'" *.php core/*/*.php Ce qui donne : feed.php:5:include(PLX_ROOT.'config.php');
index.php:5:include(PLX_ROOT.'config.php');
install.php:5:include(PLX_ROOT.'config.php');
sitemap.php:5:include(PLX_ROOT.'config.php');
core/admin/prepend.php:6:include PLX_ROOT.'config.php';
core/lib/class.plx.admin.php:141: if(!plxUtils::write("<?php define('PLX_CONFIG_PATH', '".$newpath."') ?>", PLX_ROOT.'config.php')) Toujours pour durcir la sécurité du site, il sera possible dans la prochaine version 6.0 de déplacer le dossier core/lib à l'extérieur du DocumentRoot et éventuellement le dossier data sauf data/medias. Vous avez un problème particulier avec PluXml ? |
See PR #566 |
class.plx.admin.php in PluXml allows attackers to execute arbitrary PHP code by modify the configuration file.
Source /PluXml/core/lib/class.plx.admin.php line 129~140:
Poc:
then visit /PluXml/config.php
![image](https://user-images.githubusercontent.com/9081952/52931358-0771a280-3387-11e9-80f5-984366e9f929.png)
The text was updated successfully, but these errors were encountered: