CVE-2021-3271 Stored cross-site scripting in PressBooks

Medium 4.8 Published Updated

Attackers can inject malicious scripts via the Book Info Long Description field, leading to code execution or account takeover when users view the book.

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

What is CVE-2021-3271?

CVE-2021-3271 is a medium-severity cross-site scripting vulnerability in n/a, published on 22 Jan 2021. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

Official description

PressBooks 5.17.3 contains a cross-site scripting (XSS). Stored XSS can be submitted via the Book Info's Long Description Body, and all actions to open or preview the books page will result in the triggering the stored XSS.

Weakness: CWE-79

Which versions are affected by CVE-2021-3271?

2 open source packages ship an affected version, including pressbooks/pressbooks. It affects 1 product.

PackageAffectedFixed in
pressbooks/pressbooks PackagistAll versions5.18.0
pressbooks/pressbooks PackagistAll versions5.18.0

Products include Pressbooks Pressbooks.

How do I fix CVE-2021-3271?

Upgrade pressbooks/pressbooks to 5.18.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-3271 being exploited?

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

Sources

Also known as GHSA-9652-78hp-w58c.

Is CVE-2021-3271 in your software?

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

Check your SBOMs for free