Bug #72535 [NEW]: arcfour encryption stream filter crashes php

From: Date: Sun, 03 Jul 2016 05:55:33 +0000
Subject: Bug #72535 [NEW]: arcfour encryption stream filter crashes php
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202009@lists.php.net to get a copy of this message
From: terrafrost at gmail dot com Operating system: Windows 10 PHP version: 7.0.8 Package: mcrypt related Bug Type: Bug Bug description:arcfour encryption stream filter crashes php 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 bug report at https://bugs.php.net/bug.php?id=72535&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72535&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72535&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72535&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=72535&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=72535&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=72535&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=72535&r=needscript Try newer version: https://bugs.php.net/fix.php?id=72535&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=72535&r=support Expected behavior: https://bugs.php.net/fix.php?id=72535&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=72535&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=72535&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=72535&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72535&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=72535&r=dst IIS Stability: https://bugs.php.net/fix.php?id=72535&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=72535&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=72535&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=72535&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=72535&r=mysqlcfg

« previous php.bugs (#202009) next »