ZeroHour
Help Net Securitypublished ()ingested @zeljkazorz

Drupal-based sites open to attack via double extension files (CVE-2020-13671)

criticalVulnerability exploited in the wildimportance 60CVE-2020-13671

Vulnerabilities mentionedAll →

CVEVulnerabilityCVSSEPSSFlagsAffectedExposurePublished
CVE-2020-13671
Unrestricted File Upload via Filename Sanitization Flaw in Drupal Core

CVE-2020-13671 is a file-upload flaw in Drupal core: improper sanitization of uploaded file names and their extensions allows a submitted file to bypass the allowed-extension checks (CWE-434, Unrestricted Upload of File with Dangerous Type). It is triggered when a user with upload privileges submits a crafted file name (for example, one carrying a dangerous or double extension) through any Drupal form or API path that stores uploaded files. An attacker gains the ability to plant arbitrary files on the server, and on sites where the web server executes uploaded files this can escalate to full remote code execution and site compromise. Any site running an affected release of Drupal core is exposed; the provided data lists 'Drupal core' as the affected product without enumerating version ranges. The flaw was added to CISA's Known Exploited Vulnerabilities catalog on 2022-01-18, confirming exploitation in the wild (ransomware use unknown), and EPSS assigns a 35.4% probability of exploitation within 30 days.

Do: Update Drupal core to the patched release specified in the vendor's security advisory (CISA required action: apply updates per vendor instructions). Until patched, restrict which roles can upload files, enforce strict allowed-extension lists, and ensure the public upload directory is configured so the web server does not execute uploaded files as scripts. Given the KEV listing, inspect upload directories and web logs for unexpected files or web shells.

8.835% KEV
  • Drupal core
largetens of thousands of sites (unpatched subset of Drupal's 10^5-10^6-site install base)
Full article372 words · extracted from helpnetsecurity.com · click to collapse

Admins of sites running on Drupal are urged to plug a critical security hole (CVE-2020-13671) that may be exploited by attackers to take over vulnerable sites.

CVE-2020-13671

They have also been urged to check that the vulnerability hasn’t already been covertly leveraged by attackers.

About the vulnerability (CVE-2020-13671)

CVE-2020-13671 exists because Drupal core (the standard release of Drupal) does not properly sanitize certain filenames on uploaded files.

A malicious file with a double extension (e.g., php.txt) could be “interpreted as the incorrect extension and served as the wrong MIME type or executed as PHP for certain hosting configurations,” the Drupal security team noted.

They have provided security updates with the fix and recommended admins to upgrade to Drupal version 9.0.8, 8.9.9, 8.8.11 or 7.74, depending on which Drupal branch they are currently using.

The team did not say that they aware of the vulnerability being actively exploited, but recommended admins to audit all previously uploaded files to check for malicious extensions.

“Look specifically for files that include more than one extension, like filename.php.txt or filename.html.gif, without an underscore (_) in the extension. Pay specific attention to the following file extensions, which should be considered dangerous even when followed by one or more additional extensions: phar, php, pl, py, cgi, asp, js, html, htm, phtml. This list is not exhaustive, so evaluate security concerns for other unmunged extensions on a case-by-case basis,” they advised.

Drupal-based sites form a big target

Drupal vulnerabilities are often exploited by attackers. Drupal is free and open-source content management system, and is the fourth most widely used CMS after WordPress, Shopify and Joomla.

But though the number of sites depending on Drupal is much, much smaller that the number of WordPress-based sites, it is still over a million.

Admins should also be aware that while Drupal v7.x is still maintained and receives security updates, it will reach end-of-life in November of 2021, so those who use it are urged to start planning the upgrade to a newer version, preferably 9.x.

UPDATE (November 24, 2020, 11:20 a.m. PT):

Drupal v7.x EOL has been extended until November 28, 2022, “given the impact of COVID-19 on budgets and businesses.”

Text extracted automatically; images, tables and formatting may be missing. Original: https://www.helpnetsecurity.com/2020/11/23/cve-2020-13671/