CVE-2021-3271: Stored cross-site scripting in PressBooks
4.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.52949%
CWE
Published
3/29/2021
Updated
2/1/2023
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
pressbooks/pressbooks | composer | < 5.18.0 | 5.18.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from insufficient input sanitization in book metadata handling. The commit diff shows sanitize_string() was added as a callback for several fields including pb_about_unlimited (Long Description). Prior to 5.18.0, these fields lacked proper HTML filtering. The proof-of-concept demonstrates that raw HTML/JS in Long Description was stored and executed, indicating missing sanitization in the save workflow. The vulnerable functions are those responsible for processing and storing user input in book metadata without adequate XSS protection.