Zendframework has potential Cross-site Scripting vector in multiple view helpers
Impact
Many Zend Framework 2 view helpers were using the escapeHtml() view helper in order to escape HTML attributes, instead of the more appropriate escapeHtmlAttr(). In situations where user data and/or JavaScript is used to seed attributes, this can lead to potential cross site scripting (XSS) attack vectors.
Source excerpt · OSVAffected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
| Affected range | Recorded fix |
|---|---|
| From 2.0.0 before 2.2.7Ecosystem versions | 2.2.7 |
| From 2.3.0 before 2.3.1Ecosystem versions | 2.3.1 |
Version evidence: OSV · GHSA-8q77-cv62-jj38
View original version evidence (27 explicit versions)
Original source description
Many Zend Framework 2 view helpers were using the escapeHtml() view helper in order to escape HTML attributes, instead of the more appropriate escapeHtmlAttr(). In situations where user data and/or JavaScript is used to seed attributes, this can lead to potential cross site scripting (XSS) attack vectors.
Vulnerable view helpers include:
- All
Zend\Formview helpers. - Most
Zend\Navigation(akaZend\View\Helper\Navigation\*) view helpers. - All "HTML Element" view helpers:
htmlFlash(),htmlPage(),htmlQuickTime(). Zend\View\Helper\Gravatar
References
- Patch github.com/zendframework/zendframework/commit/1dd4f8cede07469390eef1e629f808349fa1b5ea
- Patch github.com/zendframework/zendframework/commit/6742ddad7a7923163cea6dd58d27d0e946a402d1
- Security advisory framework.zend.com/security/advisory/ZF2014-03
- Security advisory github.com/FriendsOfPHP/security-advisories/blob/master/zendframework/zendframework/ZF2014-03.yaml
- Source reference github.com/zendframework/zendframework