Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.php > #4247
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Newsgroups | de.comp.lang.php |
| Subject | Sicherheitsrisiko $PHP_SELF (was: Eltern-Datei bei include) |
| Date | 2017-09-08 11:53 +0200 |
| Organization | PointedEars Software (PES) |
| Message-ID | <2037004.MrV9MI1u15@PointedEars.de> (permalink) |
| References | <oo8l5k$7j1$1@dont-email.me> <oo8pjm$fti$1@solani.org> <oo9a7r$fk0$1@dont-email.me> <oo9cfs$sqd$1@solani.org> |
Christoph M. Becker wrote:
> Am 31.08.2017 um 17:37 schrieb Ralph Stahl:
>> Christoph M. Becker schrieb:
>>> "php find including file" führt mich zu
>>> <https://stackoverflow.com/questions/6804539/get-name-of-file-that-is-including-a-php-script>.
>>
>> Vielen Dank! Die Lösung mit basename($_SERVER['PHP_SELF']) ist ja
>> richtig elegant! Ich wusste nicht, dass PHP_SELF nicht das includete
>> File meint.
>
> Das $_SERVER Array wird befüllt, bevor überhaupt ein PHP-Skript
> ausgeführt wird
Das kommt auf die entsprechende Einstellung in der php.ini an:
<http://php.net/manual/en/ini.core.php#ini.auto-globals-jit>
> – kann also gar nichts von includes wissen. Alternativ
> zu PHP_SELF könnte auch SCRIPT_FILENAME oder SCRIPT_NAME interessant
> sein. Siehe auch <http://php.net/manual/en/reserved.variables.server.php>.
$PHP_SELF bzw. $_SERVER['PHP_SELF'] zu verwenden, ist ausserdem ein
*Sicherheitsrisiko*, denn es handelt sich um eine *Variable, deren Wert der
Benutzer beeinflussen kann*:
<http://www.webadminblog.com/index.php/2010/02/23/a-xss-vulnerability-in-almost-every-php-form-ive-ever-written/>
[Etwas peinlich, dass ausgerechnet der URI von so einem Blog “index.php”
enthält – nicht nur wegen der Optik, sondern auch, weil es einem
potentiellen Angreifer Information liefert, welche Technologie
serverseitig verwendet wird.]
Gefunden in:
<https://stackoverflow.com/q/6080022/855543>
Gefunden in:
<https://stackoverflow.com/q/10272282/855543>
Gefunden mit:
<https://www.google.com/search?q=php_self+security+issue&filter=0>
Siehe auch:
<https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet>
--
PointedEars
Zend Certified PHP Engineer <http://www.zend.com/en/yellow-pages/ZEND024953>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
Back to de.comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar
Eltern-Datei bei include Ralph Stahl <post@rstahl.de> - 2017-08-31 11:38 +0200
Re: Eltern-Datei bei include "Christoph M. Becker" <cmbecker69@arcor.de> - 2017-08-31 12:49 +0200
Re: Eltern-Datei bei include Ralph Stahl <post@rstahl.de> - 2017-08-31 17:37 +0200
Re: Eltern-Datei bei include "Christoph M. Becker" <cmbecker69@arcor.de> - 2017-08-31 18:11 +0200
Sicherheitsrisiko $PHP_SELF (was: Eltern-Datei bei include) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-09-08 11:53 +0200
Re: Sicherheitsrisiko $PHP_SELF "Christoph M. Becker" <cmbecker69@arcor.de> - 2017-09-08 12:52 +0200
Re: Sicherheitsrisiko $PHP_SELF Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-09-08 12:58 +0200
Re: Eltern-Datei bei include Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2017-08-31 16:45 +0000
Re: Eltern-Datei bei include Ralph Stahl <post@rstahl.de> - 2017-09-02 09:13 +0200
csiph-web