Bug #72535 [Opn->Ver]: arcfour encryption stream filter crashes php
| From: | cmb@php.net | Date: | Sun, 03 Jul 2016 13:07:20 +0000 |
| Subject: | Bug #72535 [Opn->Ver]: arcfour encryption stream filter crashes php | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-202020@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72535&edit=1
ID: 72535
Updated by: cmb@php.net
Reported by: terrafrost at gmail dot com
Summary: arcfour encryption stream filter crashes php
-Status: Open
+Status: Verified
Type: Bug
-Package: mcrypt related
+Package: Reproducible crash
-Operating System: Windows 10
+Operating System: *
PHP Version: 7.0.8
Block user comment: N
Private report: N
New Comment:
I can reproduce the crash with PHP 5.6.23, PHP 7.0.8 and PHP
7.1.0alpha2 on Windows. A debug build of current master on Linux
reports 2 memory leaks.
Previous Comments:
------------------------------------------------------------------------
[2016-07-03 05:55:29] terrafrost at gmail dot com
Description:
------------
I don't think encryption filters are a very well known feature of mcrypt but none-the-less they
are a feature: http://php.net/manual/en/filters.encryption.php
The example in the PHP docs (with tripledes) works but arcfour does not work - you try to run it and
you get a segfault.
Test script:
---------------
<?php
$passphrase = 'My secret';
$plaintext = 'Secret secret secret data';
$iv = substr(md5('iv' . $passphrase, true), 0, 8);
$key = substr(md5('pass1' . $passphrase, true) .
md5('pass2' . $passphrase, true), 0, 24);
$opts = array('iv' => $iv, 'key' => $key, 'mode' =>
'stream');
$expected = substr($plaintext . $plaintext, 0, 48);
$fp = fopen('php://memory', 'wb+');
stream_filter_append($fp, 'mcrypt.arcfour', STREAM_FILTER_WRITE, $opts);
fwrite($fp, $plaintext);
Expected result:
----------------
The script to actually run
Actual result:
--------------
The script crashes
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72535&edit=1