CVE-2021-20848 Cross-site Scripting in github.com/schollz/rwtxt

Medium 6.1 Published Updated

A remote attacker can inject arbitrary scripts into rwtxt, potentially leading to code execution or account takeover.

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 CVE-2021-20848?

CVE-2021-20848 is a medium-severity cross-site scripting vulnerability in Zack Scholl rwtxt, published on 24 Nov 2021. 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

Cross-site scripting vulnerability in rwtxt versions prior to v1.8.6 allows a remote attacker to inject an arbitrary script via unspecified vectors.

Weakness: CWE-79

Which versions are affected by CVE-2021-20848?

3 open source packages ship an affected version, including github.com/schollz/rwtxt. It affects 1 product.

PackageAffectedFixed in
github.com/schollz/rwtxt GoAll versions1.8.6
github.com/schollz/rwtxt GoAll versions1.8.6
github.com/schollz/rwtxt GoAll versions1.8.6

Products include Rwtxt Project Rwtxt.

How do I fix CVE-2021-20848?

Upgrade github.com/schollz/rwtxt to 1.8.6 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-20848 being exploited?

There is no known exploitation of CVE-2021-20848 in the wild and no public exploit code.

Sources

Also known as GHSA-458f-26r3-x2c3, GO-2022-0231.

Is CVE-2021-20848 in your software?

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

Check your SBOMs for free