Skip to main content

PHAR OpenSSL signature bypass via algorithm downgrade

Publication Date 2026-11-19
Severity High
Type Remote Code Execution
Affected PHP Versions
  • 7.2.0-7.2.34
  • 7.3.0-7.3.33
  • 7.4.0-7.4.33
  • 8.1.0-8.1.34
  • 8.2.0-8.2.35
  • 8.3.0-8.3.36
  • 8.4.0-8.4.27
  • 8.5.0-8.5.12
Fixed Product Versions
  • ZendPHP 7.2
  • ZendPHP 7.3
  • ZendPHP 7.4
  • ZendPHP 8.1
  • ZendPHP 8.2
  • ZendPHP 8.3
  • ZendPHP 8.4
  • ZendPHP 8.5
  • ZendServer 2021.4.10

CVE Details

The Phar extension selects the signature verification method from the signature type stored in the archive, and only the OpenSSL types consult the separate .pubkey file holding the trusted public key. An attacker who can modify an OpenSSL-signed Phar archive, but not its public key file, can switch the signature type to a keyless hash such as SHA-256 with a recomputed digest, so the altered archive passes verification even with phar.require_hash enabled. An application that loads the archive may then execute attacker-controlled PHP code. Native, tar-based and zip-based phars are affected.

Recommendations

If you are developing a PHAR for distribution, ensure that your build and distribution chain is protected and prevents attacker access that could lead to PHAR modification. If you consume a PHAR from a third party, ask for confirmation and proof of distribution hardening and expected public key checksums prior to consuming the PHAR. Where possible, update to a known patched version of PHP.