|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80351 Incorrect detection of zip_*_method_supported() availability in libzip
Submitted: 2020-11-12 08:46 UTC Modified: 2020-11-12 09:46 UTC
Avg. Score:3.2 ± 1.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:2 (66.7%)
From: nvizovitin at plesk dot com Assigned: remi (profile)
Status: Assigned Package: Zip Related
PHP Version: 8.0.0RC3 OS: Any with older libzip
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2020-11-12 08:46 UTC] nvizovitin at plesk dot com
HAVE_METHOD_SUPPORTED AC_DEFINE is set incorrectly during zip extension configuration for some libzip versions < 1.7.0, such as 1.3.2.

Detection of zip_compression_method_supported() and zip_encryption_method_supported() functions availability in libzip is incorrect. They are publicly available since libzip 1.7.0, however the first one was privately available before (at least in 1.3.2), so its detection via AC_CHECK_LIB was successful where it should not have been.

This results in runtime errors which happen on attempts to use ZipArchive::isEncryptionMethodSupported() or phpinfo().

See also:

The issue was also reproduced on PHP 8.0.0RC4 ( We encountered this issue on CentOS 7 with non-system libzip build.

Test script:
php -r '$zip = new ZipArchive(); print($zip->isEncryptionMethodSupported(ZipArchive::EM_AES_256));'


php -r 'phpinfo();'

Expected result:
Provided PHP was built against libzip < 1.7.0:

PHP Fatal error:  Uncaught Error: Call to undefined method ZipArchive::isEncryptionMethodSupported() in Command line code:1
Stack trace:
#0 {main}
  thrown in Command line code on line 1


phpinfo() doesn't result in error

Actual result:
/opt/plesk/php/8.0/bin/php: symbol lookup error: /opt/plesk/php/8.0/lib64/php/modules/ undefined symbol: zip_encryption_method_supported

(in both cases)


libzip-fix-have-method-supported-detection.diff (last revision 2020-11-12 08:47 UTC by nvizovitin at plesk dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-12 08:47 UTC] nvizovitin at plesk dot com
The following patch has been added/updated:

Patch Name: libzip-fix-have-method-supported-detection.diff
Revision:   1605170847
 [2020-11-12 09:46 UTC]
-Assigned To: +Assigned To: remi
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 15 14:01:28 2024 UTC