PHP + biztonság

Fórumok

PHP + biztonság

Hozzászólások

Helló Mindenki.

PHP safe módban sikeresen letiltottam pár funkciót a regisztrált usereknek a szerveren. / passthru, exec, system...stb /
Az érdekelne, hogyan lehet beállítani, hogy egyes csoportok tagjai ezeket a letiltott funkciókat php scriptjeikben el tudják érni, és/vagy csak konkrétan meghatározott csoportok tagjaitól tiltsa le a szerver a hozzáférést...
Scriptértelmezőnek még php 4.x verzió van fent.

Debianban a php4-cli csomag nem ugyan azt a php.ini-t hasznalja mint a mod_php.

A kérdésedre nem tudom a választ, csak ha már biztonságról van szó, a PHP kapcsán ma volt a Secunián egy bejelentés DoS sebezhetőségről, gondoltam szólok, ha esetleg nem tudtátok. Az értesítő szövege:

----------------------------------------------------------------------

TITLE:
PHP Multiple Vulnerabilities

SECUNIA ADVISORY ID:
SA14792

VERIFY ADVISORY:
http://secunia.com/advisories/14792/

CRITICAL:
Moderately critical

IMPACT:
Unknown, DoS

WHERE:
From remote

SOFTWARE:
PHP 5.0.x
http://secunia.com/product/3919/
PHP 4.3.x
http://secunia.com/product/922/
PHP 4.2.x
http://secunia.com/product/105/

DESCRIPTION:
Multiple vulnerabilities have been reported in PHP, where some have
an unknown impact and others can be exploited by malicious people to
cause a DoS (Denial of Service).

1) Errors within the "php_handle_iff()" and "php_handle_jpeg()"
functions called by the "getimagesize()" PHP function can be
exploited to cause infinite loops and consume all available CPU
resources via a specially crafted image.

This has been reported in versions 4.2.2, 4.3.9, 4.3.10, and 5.0.3.
Other versions may also be affected.

2) Multiple unspecified security issues exist in the exif and fbsql
extensions and in the "unserialize()" and "swf_definepoly()" PHP
functions.

Other bugs have also been reported where some may be security
related.

SOLUTION:
Update to version 4.3.11 or 5.0.4.
http://www.php.net/downloads.php

PROVIDED AND/OR DISCOVERED BY:
1) Discovered by anonymous person and reported via iDEFENSE.
2) Reported by vendor.

ORIGINAL ADVISORY:
The PHP Group:
http://www.php.net/release_4_3_11.php

iDEFENSE:
http://www.idefense.com/application/poi/display?id=222&type=vulnerabilities

----------------------------------------------------------------------

About:
This Advisory was delivered by Secunia as a free service to help
everybody keeping their systems up to date against the latest
vulnerabilities.

Subscribe:
http://secunia.com/secunia_security_advisories/

Definitions: (Criticality, Where etc.)
http://secunia.com/about_secunia_advisories/

Please Note:
Secunia recommends that you verify all advisories you receive by
clicking the link.
Secunia NEVER sends attached files with advisories.
Secunia does not advise people to install third party patches, only
use those supplied by the vendor.

Az érdekelne, hogyan lehet beállítani, hogy egyes csoportok tagjai ezeket a letiltott funkciókat php scriptjeikben el tudják érni, és/vagy csak konkrétan meghatározott csoportok tagjaitól tiltsa le a szerver a hozzáférést...

Ha netán véletlenül Apache webservered lenne, megoldható lenne úgy, hogy a konfigurációs fileba beleírod, pl. Directory, vagy VirtualHost tagbe, hogy [code:1:6649932a60]php_admin_value open_basedir /bizonytalan/scriptek/helye[/code:1:6649932a60]

Én személy szerint nem tiltottam le az programfuttató függvényeket (http://hu.php.net/exec), hanem raktam egy safe_mode_exec_dir-t a php konfigba. Ez azt eredményezi, hogy a programfuttató függvények csak ebből a könyvtárból tudnak programokat futtatni. Erre azért volt szükség, mert néhány scriptemben külső programokat akartam futtatni.