php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #74066 Expanding list of functions that spread the tainted mark
Submitted: 2017-02-09 16:34 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: craig at craigfrancis dot co dot uk Assigned:
Status: Open Package: taint (PECL)
PHP Version: 7.0.15 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.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: craig at craigfrancis dot co dot uk
New email:
PHP Version: OS:

 

 [2017-02-09 16:34 UTC] craig at craigfrancis dot co dot uk
Description:
------------
I've only just stated using the extension, but I'd have thought that the following would have raised warnings.

Test script:
---------------
<?php

    $tainted = '1-Evil';
    taint($tainted);
    
    preg_match('/^1-(.*)/', $tainted, $matches);
    
    echo $matches[1] . "\n";
    echo str_ireplace('1-', '2-', $tainted) . "\n";
    echo preg_replace('/^1-/', '2-', $tainted) . "\n";

?>

Expected result:
----------------
Evil
2-Evil
2-Evil

Actual result:
--------------
<br />
<b>Warning</b>:  main() [echo]: Attempt to echo a string that might be tainted in <b>./index.php</b> on line <b>8</b><br />
1-Evil
<br />
<b>Warning</b>:  main() [echo]: Attempt to echo a string that might be tainted in <b>./index.php</b> on line <b>9</b><br />
2-Evil
<br />
<b>Warning</b>:  main() [echo]: Attempt to echo a string that might be tainted in <b>./index.php</b> on line <b>10</b><br />
2-Evil

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-02-09 16:50 UTC] craig at craigfrancis dot co dot uk
Correction... Expected result <> Actual result
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jul 25 04:01:23 2021 UTC