CVE-2021-46888 Cross-site scripting in n/a
Stored XSS in hledger allows attackers to execute JavaScript via base64-encoded payloads in JSON output, affecting users viewing generated reports.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-46888?
CVE-2021-46888 is a medium-severity cross-site scripting vulnerability in n/a, published on 21 May 2023. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
An issue was discovered in hledger before 1.23. A Stored Cross-Site Scripting (XSS) vulnerability exists in toBloodhoundJson that allows an attacker to execute JavaScript by encoding user-controlled values in a payload with base64 and parsing them with the atob function.
Weakness: CWE-79
Which versions are affected by CVE-2021-46888?
1 open source package ship an affected version, including hledger-web. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
hledger-web Hackage | From 0.24 | 1.23 |
Products include Hledger Hledger.
How do I fix CVE-2021-46888?
Upgrade hledger-web to 1.23 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-46888 being exploited?
There is no known exploitation of CVE-2021-46888 in the wild and no public exploit code.
Sources
Also known as GHSA-9fcq-h23h-rxhx, HSEC-2023-0008.