Skip to main content

Information disclosure via out-of-bounds read in stream filters

Publication Date 2026-09-25
Severity Moderate
Type Information Disclosure
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.33
  • 8.3.0-8.3.34
  • 8.4.0-8.4.25
  • 8.5.0-8.5.10
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.8

CVE Details

The convert.base64-encode, convert.quoted-printable-encode and convert.quoted-printable-decode stream filters accept a line-break-chars option whose length is tracked separately from the string itself. Providing a NUL byte within the line-break-chars option causes the filter constructor to duplicate the value with pestrdup(), which stops at the first NUL byte, while keeping the original length. When the filter later emits a line break, it copies the recorded length out of the truncated allocation, reading past its end and placing adjacent heap bytes into the filter output. In practice, this could leak sensitive data, such as credentials, private keys, or other memory contents.

Recommendations

Never use NUL as a line-break-chars option to the various convert.* stream filters. If you absolutely must, update to a patched version of PHP.