Bug 1260315 - Wrong warning by PHP openssl_encrypt() for missing IV even IV is not required
Wrong warning by PHP openssl_encrypt() for missing IV even IV is not required
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: php (Show other bugs)
6.7
All Linux
unspecified Severity medium
: rc
: ---
Assigned To: Web Stack Team
Petr Šplíchal
: Patch, Upstream
Depends On:
Blocks: 1254457 1269913
  Show dependency treegraph
 
Reported: 2015-09-05 18:39 EDT by Robert Scheck
Modified: 2016-05-31 21:45 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-10 17:39:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Robert Scheck 2015-09-05 18:39:58 EDT
Description of problem:
When running e.g. phpMyAdmin 4.4.14 on RHEL 6 this causes a warning:

  openssl_encrypt(): Using an empty Initialization Vector (iv) is potentially 
    insecure and not recommended

This however is not a bug in phpMyAdmin, but in PHP 5.3.3 as shipped by
RHEL 6 and is already fixed at upstream.

Finally, something like

  openssl_encrypt(str_repeat('.', 16), 'aes-256-ecb', str_repeat('a', 32), 
    true);

causes the warning while ECB mode doesn't make use of an IV.

Note: This requires phpMyAdmin 4.4.x as shipped by upstream, not the EPEL
package (which is 4.0.x due to the old MySQL version in RHEL 6). And this
also requires a MariaDB (either via SCL or remote).

Version-Release number of selected component (if applicable):
php-5.3.3-46.el6_6

How reproducible:
Everytime, see above and below.

Actual results:
Wrong warning of openssl_encrypt() for missing IV even IV is not required.

Expected results:
No warning.

Additional info:
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613815
- http://git.php.net/?p=php-src.git;a=commitdiff;h=412d15168192fdd3afafca5cff034bb5b451942f
- http://git.php.net/?p=php-src.git;a=commit;h=a4252ab2be8a0231477396fd475397b23a089d0e
Comment 1 Robert Scheck 2015-09-05 18:49:11 EDT
Cross-filed case/ticket 01503945 on the Red Hat customer portal.
Comment 3 Remi Collet 2015-09-10 07:26:24 EDT
Low risk patch (same code still used in latest versions)

Nice to have especially as we encourage the use of openssl extension for encryption (instead of dead mcrypt).

php-phpseclib test suite is a good reproducer.
Comment 5 Remi Collet 2015-12-09 10:22:19 EST
Both reproducer from description and phpseclib test suite ok with linked patch.
Comment 11 errata-xmlrpc 2016-05-10 17:39:01 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0842.html

Note You need to log in before you can comment on or make changes to this bug.