CVE-2022-28397
📋 TL;DR
CVE-2022-28397 is an arbitrary file upload vulnerability in Ghost CMS v4.42.0 that allows attackers to upload malicious files and potentially execute arbitrary code on the server. This affects Ghost CMS installations running the vulnerable version. The vendor notes this is intentional functionality for trusted users, but improper access controls could expose the vulnerability.
💻 Affected Systems
- Ghost CMS
📦 What is this software?
Ghost by Ghost
⚠️ Risk & Real-World Impact
Worst Case
Full server compromise allowing remote code execution, data theft, and complete system control.
Likely Case
Unauthorized file upload leading to defacement, data manipulation, or limited code execution depending on server configuration.
If Mitigated
No impact if proper user authentication and file validation controls are implemented as intended.
🎯 Exploit Status
Exploitation requires access to file upload functionality, which should be restricted to authenticated users.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: v4.42.1 and later
Vendor Advisory: https://ghost.org/docs/security/
Restart Required: Yes
Instructions:
1. Backup your Ghost installation and database. 2. Update Ghost CMS to v4.42.1 or later using npm update or Ghost CLI. 3. Restart the Ghost service.
🔧 Temporary Workarounds
Restrict File Upload Permissions
allLimit file upload functionality to only trusted administrative users.
Configure user roles in Ghost admin panel to restrict upload permissions
Implement File Type Validation
allAdd server-side validation to reject potentially dangerous file types.
Modify Ghost configuration or add middleware to validate file extensions and MIME types
🧯 If You Can't Patch
- Disable file upload functionality entirely if not required
- Implement strict access controls and audit all users with upload permissions
🔍 How to Verify
Check if Vulnerable:
Check Ghost version in admin panel or run 'ghost version' command
Check Version:
ghost version
Verify Fix Applied:
Confirm version is v4.42.1 or later and test file upload restrictions
📡 Detection & Monitoring
Log Indicators:
- Unusual file uploads, especially with executable extensions
- Multiple failed upload attempts from single user
Network Indicators:
- HTTP POST requests to upload endpoints with suspicious file names
SIEM Query:
source="ghost.log" AND ("upload" OR "file") AND ("php" OR "exe" OR "sh" OR suspicious_extension)
🔗 References
- http://ghost.com
- https://ghost.org/customers/
- https://ghost.org/docs/security/#privilege-escalation-attacks
- https://github.com/TryGhost/Ghost
- https://trends.builtwith.com/cms/Ghost
- https://youtu.be/PncfBetPk2g
- http://ghost.com
- https://ghost.org/customers/
- https://ghost.org/docs/security/#privilege-escalation-attacks
- https://github.com/TryGhost/Ghost
- https://trends.builtwith.com/cms/Ghost
- https://youtu.be/PncfBetPk2g