|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39211 setcookie XSS SECURITY bug
Submitted: 2006-10-20 13:59 UTC Modified: 2006-10-28 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: josecarlos dot norte at gmail dot com Assigned:
Status: No Feedback Package: Unknown/Other Function
PHP Version: 4.4.4 OS: all
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-10-20 13:59 UTC] josecarlos dot norte at gmail dot com
the php function setcookie (ext/standar/head.c) is vulnerable to XSS issue, when parameters passed to setcookie comes from $_REQUEST, an attacker can produce a crash in php, and execute html/javascript code in the context of the vulnerable site.

The example provided produce a Warning in php, and in the content of the warning html code is interpreted by the browser.

Reproduce code:

setcookie("\n<h1>XSS'ED!</h1>","bug in setcookie function");


Expected result:
the warning message should be parsed to clean html code, like all warnings in php, for security reasons

Actual result:
crash with html code executed.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-20 14:26 UTC]
Please try using this CVS snapshot:
For Windows:

Can't reproduce.
 [2006-10-28 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 11:01:29 2024 UTC