Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. zendframework/zendframework1
  4. ›
  5. GHSA-gwpm-pm6x-h7rj

GHSA-gwpm-pm6x-h7rj: ZendFramework Cross-site Scripting vector in `Zend_Filter_StripTags`

June 7, 2024

Zend_Filter_StripTags is a filtering class analogous to PHP’s strip_tags() function. In addition to stripping HTML tags and selectively keeping those provided in a allowlist, it also provides the ability to allowlist specific attributes to retain per allowlisted tag.

The reporter discovered that attributes that contained allowspace, and in paricular, line breaks, surrounding the attribute assignment operator would not be stripped, regardless of whether or not they were allowlisted. As examples of input affected:

<!-- newlines before and/or after assignment: -->
<a href="http://framework.zend.com/issues" onclick
=
"alert('Broken'); return false;">Issues</a>

When passed to the following code:

$filter = new Zend_Filter_StripTags(array('a' => array('href')));
$value  = $filter->($html);

then the “onclick” attribute would remain, even though it was not specified in the tag’s allowlist. This could open potential cross-site scripting attack (XSS) vectors.

References

  • framework.zend.com/security/advisory/ZF2009-02
  • github.com/FriendsOfPHP/security-advisories/blob/master/zendframework/zendframework1/ZF2009-02.yaml
  • github.com/advisories/GHSA-gwpm-pm6x-h7rj
  • github.com/zendframework/zf1

Code Behaviors & Features

Detect and mitigate GHSA-gwpm-pm6x-h7rj with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 1.7.0 before 1.7.6

Fixed versions

  • 1.7.6

Solution

Upgrade to version 1.7.6 or above.

Impact 6.1 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

packagist/zendframework/zendframework1/GHSA-gwpm-pm6x-h7rj.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:41 +0000.