|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78573 XSS via file name
Submitted: 2019-09-20 07:58 UTC Modified: 2019-09-20 08:19 UTC
From: manamtabeshekan at gmail dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 7.3.9 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
44 - 34 = ?
Subscribe to this entry?

 [2019-09-20 07:58 UTC] manamtabeshekan at gmail dot com
Displaying error messages (filename) is vulnerable to XSS, We just need to set the name of a PHP file to something like this: <img src=x

Test script:
<img src=x onerror=alert('XSS')>.php:


$file = $_GET['f'];
$f = fopen($file, 'r');


Expected result:
When you open this file in your browser you will get 2 XSS popups.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-09-20 08:02 UTC]
-Status: Open +Status: Not a bug
 [2019-09-20 08:02 UTC]
Please don't shoot yourself in the foot.
 [2019-09-20 08:19 UTC]
If you are not interested in the error, then please consult the error supression operator:
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Mar 24 15:03:44 2023 UTC