CVE-2021-25974: Cross site scripting in publify
5.4
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.43188%
CWE
Published
5/24/2022
Updated
1/27/2023
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| publify_core | rubygems | >= 8.0, < 9.2.5 | 9.2.5 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The core vulnerability stems from two key issues:
- ContentBase#html_postprocess lacked HTML sanitization in vulnerable versions, directly allowing unsafe user input into rendered pages. The patch explicitly adds sanitize call.
- nofollowify_links' original gsub implementation didn't properly handle HTML safety contexts and could be bypassed. The patch's scrubber-based approach and html_safe requirement indicate prior unsafe handling. Supporting evidence includes:
- Multiple view templates removed 'raw' calls (e.g., _article_excerpt.html.erb), indicating prior unsafe HTML output
- Added spec tests verifying html_safe status
- CWE-79 alignment with improper input neutralization during web page generation