CVE-2021-25987 Hexo - Stored XSS
A local attacker can inject arbitrary JavaScript into Hexo posts or tags, leading to stored XSS when the site is generated.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-25987?
CVE-2021-25987 is a medium-severity cross-site scripting vulnerability in Hexo, published on 30 Nov 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
Hexo versions 0.0.1 to 5.4.0 are vulnerable against stored XSS. The post “body” and “tags” don’t sanitize malicious javascript during web page generation. Local unprivileged attacker can inject arbitrary code.
Weakness: CWE-79
Which versions are affected by CVE-2021-25987?
2 open source packages ship an affected version, including hexo. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
hexo npm | From 0.0.1 | 6.0.0 |
hexo npm | From 0.0.1 | 6.0.0 |
Products include Hexo Hexo.
How do I fix CVE-2021-25987?
Upgrade hexo to 6.0.0 or later.
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 CVE-2021-25987 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-25987 exists.
Other vulnerabilities in Hexo
Sources
Also known as GHSA-q54r-r9pr-w7qv.