0
1
Fork 0

Solucionados fallos de seguridad en la configuracion y en inyeccion php

This commit is contained in:
Juan Ferrer Toribio 2014-05-10 12:47:57 +02:00
parent c30dbce493
commit 9943703f61
10 changed files with 26 additions and 6 deletions

1
DEBIAN/conffiles Normal file
View File

@ -0,0 +1 @@
/etc/hedera-web/config.php

View File

@ -1,8 +1,8 @@
Package: hedera-web
Version: 1.0-1
Version: 1.0-3
Architecture: all
Maintainer: Juan Ferrer Toribio <juan@verdnatura.es>
Depends: php5-mysql, php5-imap
Depends: apache2, php5-mysql
Section: misc
Priority: optional
Description: Verdnatura's web page

4
DEBIAN/postinst Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
service apache2 reload

4
DEBIAN/prerm Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
service apache2 reload

View File

@ -33,7 +33,7 @@ if (Hedera::login ())
if (isset ($_REQUEST['action']))
$action = $_REQUEST['action'];
if ($action)
if ($action && checkToken ($action))
{
$actionFile = 'ajax/'. $action .'.php';

View File

@ -19,7 +19,7 @@ if (!Hedera::$sysConn->isOpen ())
// Getting the section
if (isset ($_GET['section']))
if (isset ($_GET['section']) && checkToken ($_GET['section']))
$section = $_GET['section'];
else
$section = 'login';

View File

@ -5,7 +5,7 @@ require_once ('php/web/hedera.php');
Hedera::init ();
Hedera::login ();
if (isset ($_GET['module']))
if (isset ($_GET['module']) && checkToken ($_GET['module']))
$module = $_GET['module'];
else
$module = $conf['defaultModule'];

View File

@ -1,6 +1,5 @@
<?php
require_once ('config.php');
require_once ('php/vn/type.php');
require_once ('php/vn/locale.php');
require_once ('php/vn/error.php');

View File

@ -1,8 +1,20 @@
<?php
$homeConf = $_SERVER['CONTEXT_DOCUMENT_ROOT'].'/../.config/hedera-web/config.php';
if (file_exists ($homeConf))
require_once ($homeConf);
else
require_once ('/etc/hedera-web/config.php');
require_once ('php/db/db.php');
require_once ('php/web/auth.php');
function checkToken ($token)
{
return preg_match ('/^[\w\-]+$/', $token);
}
function ifNull ($map, $key)
{
return isset ($map[$key]) ? $map[$key] : NULL;