php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52189 Certain errors are not sanitized against htmlspecialchars
Submitted: 2010-06-26 10:52 UTC Modified: 2010-06-26 12:19 UTC
From: staff at humaninternals dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.3.0 OS: Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: staff at humaninternals dot com
New email:
PHP Version: OS:

 

 [2010-06-26 10:52 UTC] staff at humaninternals dot com
Description:
------------
I have currently tested this on PHP 5.3.0 on a Windows XP environment.
Although it is unlikely that this type of data will be from user input but 
consider the test script.
When an undefined index notice occurs the index itself is not sanitized allowing 
for XSS type attacks.
Again it is very unlikely that this should come from user input but it is 
possible.

Test script:
---------------
error_reporting(E_ALL | E_STRICT);
$a = array();
echo $a['<script>alert("A")</script>'];

Expected result:
----------------
Notice: Undefined index: <script>alert("A")</script> in ...file...

Actual result:
--------------
Notice: Undefined index: in ...file...

And a script alert popup.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-26 12:14 UTC] staff at humaninternals dot com
-Package: Output Control +Package: Unknown/Other Function -PHP Version: 5.3SVN-2010-06-26 (snap) +PHP Version: 5.3.0
 [2010-06-26 12:14 UTC] staff at humaninternals dot com
Wrong package.
 [2010-06-26 12:19 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2010-06-26 12:19 UTC] pajoye@php.net
Do not set display_errors.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Aug 13 17:00:02 2025 UTC