Bug #66090 [NEW]: echo function in a script tag problem
| From: | leesec dot com at gmail dot com | Date: | Wed, 13 Nov 2013 14:18:00 +0000 |
| Subject: | Bug #66090 [NEW]: echo function in a script tag problem | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-182735@lists.php.net to get a copy of this message | ||
From: leesec dot com at gmail dot com
Operating system: win 7
PHP version: Irrelevant
Package: *General Issues
Bug Type: Bug
Bug description:echo function in a script tag problem
Description:
------------
Test environment is as follows:
---------------------------------
PHP version:5.4.16
Apache version:2.4.4
Mysql version:5.6.12
---------------------------------
Test script:
---------------
Copy the following code:
-------------------------------------------------------------------------
<html>
<head>
<title>Hello World</title>
<meta http-equiv="Content-type" content="text/html;charset=utf-8" />
<script>
var a="<?php echo $_GET['name'] ?>";
</script>
</head>
<body>
</body>
</html>
-----------------------------------------------------------------
Save as test.php, then run http://localhost/test.php (no
parameters)
The browser's source code leak path found
Then view browser's source code with the following code:
<script>
var a="<br />
<font size='1'><table class='xdebug-error xe-notice'
dir='ltr'
border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900'
colspan="5"><span
style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>(
! )</span> Notice: Undefined index: name in E:\wamp\www\test.php on line
<i>7</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call
Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th
align='left'
bgcolor='#eeeeec'>Time</th><th align='left'
bgcolor='#eeeeec'>Memory</th><th align='left'
bgcolor='#eeeeec'>Function</th><th align='left'
bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td
bgcolor='#eeeeec'
align='center'>0.0000</td><td bgcolor='#eeeeec'
align='right'>139408</td><td bgcolor='#eeeeec'>{main}(
)</td><td
title='E:\wamp\www\test.php'
bgcolor='#eeeeec'>..\test.php<b>:</b>0</td></tr>
</table></font>
";
</script>
--
Edit bug report at https://bugs.php.net/bug.php?id=66090&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66090&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66090&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66090&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66090&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66090&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66090&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66090&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66090&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66090&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66090&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66090&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66090&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66090&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66090&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66090&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66090&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66090&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66090&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66090&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66090&r=mysqlcfg