Zend-Form vulnerable to Cross-site Scripting
The advisory, in context
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
Affected 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.
From 2.0.0 before 2.2.7
Fixed in 2.2.7
23 explicitly affected versions
2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.2.0, 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.2.6
View affected-version evidence
{
"ranges": [
{
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.2.7"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"2.0.3",
"2.0.4",
"2.0.5",
"2.0.6",
"2.0.7",
"2.0.8",
"2.1.0",
"2.1.1",
"2.1.2",
"2.1.3",
"2.1.4",
"2.1.5",
"2.1.6",
"2.2.0",
"2.2.0rc1",
"2.2.0rc2",
"2.2.0rc3",
"2.2.1",
"2.2.2",
"2.2.3",
"2.2.4",
"2.2.5",
"2.2.6"
]
}From 2.3.0 before 2.3.1
Fixed in 2.3.1
1 explicitly affected versions
2.3.0
View affected-version evidence
{
"ranges": [
{
"events": [
{
"introduced": "2.3.0"
},
{
"fixed": "2.3.1"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"2.3.0"
]
}References
- https://github.com/zendframework/zend-form/commit/6fe40314e8e3477494aadd03d62573bd1c212bd1
- https://github.com/zendframework/zend-form/commit/d7a1f5bc4626b1df990391502a868b28c37ba65d
- https://github.com/zendframework/zend-form/commit/fd43a951460c4bc60c77a566129705f6bdb9c61b
- https://framework.zend.com/security/advisory/ZF2014-03
- https://github.com/FriendsOfPHP/security-advisories/blob/master/zendframework/zend-form/ZF2014-03.yaml
- https://github.com/zendframework/zend-form