Description Preview
A vulnerability in Craft CMS allows arbitrary file extensions to be rendered as Twig templates due to insufficient validation in the template resolution process. Specifically, in the View.php file, the doesTemplateExist() function calls resolveTemplate(), which calls _resolveTemplateInternal(), which then calls _resolveTemplate(). When the name parameter value is not an empty string, the function returns directly without proper extension verification. This allows attackers with admin privileges to exploit the vulnerability on development environments or improperly configured staging/production environments, potentially achieving remote code execution and gaining access to the host operating system.
Overview
This vulnerability (CVE-2023-32679) affects Craft CMS versions prior to 4.4.6. The issue stems from improper validation of file extensions in the template resolution process, which can be exploited by authenticated administrators to execute arbitrary code. The vulnerability is particularly dangerous in development environments or improperly configured staging/production environments where an attacker with admin access could leverage this flaw to gain control of the underlying operating system. The vulnerability is in the template resolution chain where the code bypasses extension verification under certain conditions.
Remediation
- Update to Craft CMS version 4.4.6 or later, which contains the fix for this vulnerability.
- If immediate updating is not possible, ensure that admin access is strictly limited to trusted users only.
- Properly configure staging and production environments with appropriate security controls.
- Implement the principle of least privilege for all CMS administrators.
- Regularly audit your Craft CMS installations for security best practices.
- There are no known workarounds for this vulnerability other than upgrading.
References
- GitHub Security Advisory: https://github.com/craftcms/cms/security/advisories/GHSA-vqxf-r9ph-cc9c
- Craft CMS Security Releases: https://craftcms.com/knowledge-base/security-releases
- CVE-2023-32679 Details: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-32679
Industry ExposureMost to leastThis section illustrates the prevalence of a specific Common Vulnerabilities and Exposures (CVE) across various industries based on customer reports. The ranking displays industries from the most to least affected by this particular vulnerability, offering valuable insight into where this CVE has been most frequently observed. This information can help organizations within these sectors prioritize their security efforts, understand their relative risk exposure compared to their peers, and focus remediation strategies where they are most needed. By understanding the industry-specific impact, organizations can make more informed decisions regarding patching, resource allocation, and overall risk management related to this CVE.
This section illustrates the prevalence of a specific Common Vulnerabilities and Exposures (CVE) across various industries based on customer reports. The ranking displays industries from the most to least affected by this particular vulnerability, offering valuable insight into where this CVE has been most frequently observed. This information can help organizations within these sectors prioritize their security efforts, understand their relative risk exposure compared to their peers, and focus remediation strategies where they are most needed. By understanding the industry-specific impact, organizations can make more informed decisions regarding patching, resource allocation, and overall risk management related to this CVE.
- Accommodation & Food ServicesAccommodation & Food Services
- Administrative, Support, Waste Management & Remediation ServicesAdministrative, Support, Waste Management & Remediation Services
- Agriculture, Forestry Fishing & HuntingAgriculture, Forestry Fishing & Hunting
- Arts, Entertainment & RecreationArts, Entertainment & Recreation
- ConstructionConstruction
- Educational ServicesEducational Services
- Finance and InsuranceFinance and Insurance
- Health Care & Social AssistanceHealth Care & Social Assistance
- InformationInformation
- Management of Companies & EnterprisesManagement of Companies & Enterprises
- ManufacturingManufacturing
- MiningMining
- Other Services (except Public Administration)Other Services (except Public Administration)
- Professional, Scientific, & Technical ServicesProfessional, Scientific, & Technical Services
- Public AdministrationPublic Administration
- Real Estate Rental & LeasingReal Estate Rental & Leasing
- Retail TradeRetail Trade
- Transportation & WarehousingTransportation & Warehousing
- UtilitiesUtilities
- Wholesale TradeWholesale Trade