note 8760 rejected and deleted from fopen by rasmus

From: Date: Sat, 11 Nov 2000 06:22:33 +0000
Subject: note 8760 rejected and deleted from fopen by rasmus
Groups: php.notes 
Request: Send a blank email to php-notes+get-7594@lists.php.net to get a copy of this message
Possible security-problem with fopen() if error-reporting is not suppressed. Imagine you use 2 scripts on same or different hosts, but only first one is visible for the user. Within the first script, you construct an URL with some (maybe not public) parameters to call the second script, parse it's output and return something to the user, still from the first script. #we are in script1.php and we construct the URL, then we try to open it $filename="http://domain.com/script2.php?someparam=1&somemore=2"; $fh = fopen($filename, "r"); if ($fh) { # ... } If the host (of second script) is not reachable, we wait a while and then get (with 'normal' error-reporting) the following text with the users browser-window. Warning: fopen("http://domain.com/script2.php?someparam=1&somemore=2","r") - Unknown error in domain.comscript1.phtml on line xxx The error-report shows the whole (not public) filename of the second script including all (not public) params instead of a simple connection timeout-message. Make sure that you set error_reporting if you have to use such constructions.

« previous php.notes (#7594) next »