WARNING: UNAUTHENTICATED REMOTE CODE EXECUTION (RCE) VULNERABILITIES ON STRAPI SERVERS, PATCH IMMEDIATELY!
CVE-2023-22894, CVSS 9.8: AV: N/AC: L/PR: N/UI: N/S:U/C:H/I:H/A:H
CVE-2023-22621, CVSS 10: AV: N/AC: L/PR: N/UI:N/S:C/C:H/I:H/A:H
Strapi is a headless CMS that is used to develop websites, mobile applications, eCommerce sites, and APIs. It allows organisations to create an API for the backend or databases without technical knowledge. The system builds APIs based on content models automatically.
By successfully exploiting both CVE-2023-22621 and CVE-2023-22894, an unauthenticated remote attacker can exploit and hijack a super admin account via the admin panel and use that account to modify the users-permissions template, which makes it possible to execute arbitrary code on vulnerable Strapi servers.
When both vulnerabilities are successfully exploited it has a high impact on Confidentiality, Integrity, and availability.
The Centre for Cyber security Belgium recommends system administrators to patch vulnerable systems as soon as possible and to analyse system and network logs for any suspicious activity. If your organization has already identified an intrusion or incident, please report it via: https://cert.be/en/report-incident.
CVE-2023-22894 leaks sensitive user information by filtering on private fields from a query.
CVE-2023-22621 is a server-side template injection vulnerability impacting Strapi’s users-permission plugin’s email template system.
CVE-2023-22894 and CVE-2023-22621 can be chained together in an automated script to hijack Super Admin Users via the admin panel and then execute code as an unauthenticated user on all Strapi servers running versions prior to 4.5.5.
To be successfully exploited, an attacker must first exploit CVE-2023-22894 to obtain a new password for a super administrator account and grab the API token for the admin API.
The Centre for Cyber security Belgium recommends system administrators to patch vulnerable systems as soon as possible and to analyze system and network logs for any suspicious activity.
Recommended method to detect exploitation
You can detect indicators of compromise (IoC) on your systems by following the procedures below.
Detecting exploitation of CVE-2023-22621
- Look if a Strapi email template was modified on your server using the request log files by searching for a PUT request to URL path /users-permissions/email-templates
- If you find this, immediately check if there are no malicious applications running on your servers.
Detecting exploitation of CVE-2023-22894
- Search log files for the payload, which is within the GET parameters normally included in request logs by using grep -iE '(\[|%5B)\s*(email|password|reset_password_token|resetPasswordToken)\s*(\]|%5D)' $PATH_TO_LOG_FILE
- If this regex pattern matches lines in the log files, look out for multiple requests that include password, reset_password_token or resetPasswordToken. This would indicate that an attacker has leaked password hashes and reset tokens on the Strapi server.
If your organization has already identified an intrusion or incident, please report it via: https://cert.be/en/report-incident.