GHSA-m7hr-j867-3f34 ZendFramework has potential Cross-site Scripting vector in multiple view helpers

Not scored Published

Insufficient HTML attribute escaping in Zend Framework view helpers allows attackers to execute arbitrary scripts via cross-site scripting.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is GHSA-m7hr-j867-3f34?

GHSA-m7hr-j867-3f34 is a cross-site scripting vulnerability in zendframework/zend-view, published on 7 Jun 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official 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\Form view helpers.
  • Most Zend\Navigation (aka Zend\View\Helper\Navigation\*) view helpers.
  • All "HTML Element" view helpers: htmlFlash(), htmlPage(), htmlQuickTime().
  • Zend\View\Helper\Gravatar

Which versions are affected by GHSA-m7hr-j867-3f34?

4 open source packages ship an affected version, including zendframework/zend-view.

PackageAffectedFixed in
zendframework/zend-view PackagistFrom 2.0.02.2.7
zendframework/zend-view PackagistFrom 2.0.02.2.7
zendframework/zend-view PackagistFrom 2.3.02.3.1
zendframework/zend-view PackagistFrom 2.3.02.3.1

How do I fix GHSA-m7hr-j867-3f34?

Upgrade zendframework/zend-view to a fixed version for your release line: 2.2.7 or 2.3.1.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is GHSA-m7hr-j867-3f34 being exploited?

There is no known exploitation of GHSA-m7hr-j867-3f34 in the wild and no public exploit code.

Sources

Is GHSA-m7hr-j867-3f34 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free