php.net |  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: manamtabeshekan at gmail dot com
New email:
PHP Version: OS:

 

 [2019-09-20 07:58 UTC] manamtabeshekan at gmail dot com
Description:
------------
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
onerror=alert('XSS')>.php

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

<?php

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

?>


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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-09-20 08:02 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2019-09-20 08:02 UTC] requinix@php.net
Please don't shoot yourself in the foot.
 [2019-09-20 08:19 UTC] kalle@php.net
If you are not interested in the error, then please consult the error supression operator:
https://www.php.net/manual/en/language.operators.errorcontrol.php
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Apr 20 11:01:23 2021 UTC