Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Vulnerabilities

Drupal Updates Patch Vulnerability in Twig Template Engine

Updates announced for Drupal this week address a severe vulnerability in Twig that could lead to the leakage of sensitive information.

Drupal is a PHP-based open source web content management system that has been using Twig as its default templating engine since Drupal 8, which was first released in November 2015.

Updates announced for Drupal this week address a severe vulnerability in Twig that could lead to the leakage of sensitive information.

Drupal is a PHP-based open source web content management system that has been using Twig as its default templating engine since Drupal 8, which was first released in November 2015.

Tracked as CVE-2022-39261, the vulnerability could allow an attacker to load templates outside a configured directory, via the filesystem loader.

“When using the filesystem loader to load templates for which the name is a user input, it is possible to use the ‘source’ or ‘include’ statement to read arbitrary files from outside the templates directory when using a namespace like ‘@somewhere/../some.file’ (in such a case, validation is bypassed),” Twig explains.

The vulnerability has been assigned a ‘high’ severity rating, or ‘critical’ based on the scoring system used by Drupal. Twig has addressed the flaw with the release of versions 1.44.7, 2.15.3, and 3.4.3.

“Multiple vulnerabilities are possible if an untrusted user has access to write Twig code, including potential unauthorized read access to private files, the contents of other files on the server, or database credentials,” Drupal notes in an advisory.

Advertisement. Scroll to continue reading.

The security flaw is mitigated by the fact that an attacker requires a restricted access administrative permission to exploit the vulnerability. However, Drupal notes that contributed or custom code allowing users to write Twig templates may create additional exploit paths.

Drupal addressed the vulnerability with the release of Drupal 9.4.7 and Drupal 9.3.22. While end-of-life versions prior to Drupal 9.3 will not receive a patch, Drupal 7 core iterations are not affected, as they do not include Twig.

This week, Drupal also announced a patch for the S3 File System, to resolve an access bypass issue. The module, which is meant to allow S3-compatible storage to be used as a Drupal filesystem, fails to “sufficiently prevent file access across multiple filesystem schemes stored in the same bucket”.

“This vulnerability is mitigated by the fact that an attacker must obtain a method to access arbitrary file paths, the site must have public or private takeover enabled, and the file metadata cache must be ignored,” Drupal notes.

Users who rely on the S3 File System module for Drupal 7.x are advised to update to version 7.x-2.14 of the module, which resolves the vulnerability.

Related: Drupal Updates Patch Another Vulnerability Related to Archive Files

Related: Access Bypass, Data Overwrite Vulnerabilities Patched in Drupal

Related: Code Execution and Other Vulnerabilities Patched in Drupal

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing for the latest cybersecurity threats, trends, and expert insights.

Click to comment

Trending

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Delve into big-picture strategies to reduce attack surfaces, improve patch management, conduct post-incident forensics, and tools and tricks needed in a modern organization.

Register

Organizations are investing heavily in third-party risk management, but breaches, delays, and blind spots continue to persist. Join this live webinar as we examine the gap between how organizations think their third-party risk programs are performing and what’s actually happening in practice.

Register

People on the Move

Anurag Jain has been appointed Senior Vice President of Engineering at CodeHunter

CTERA has appointed Tal Sarfaty as Senior Vice President of Cybersecurity.

Quantum Secure Encryption has named Michael Massing as Chief Technology Officer.

More People On The Move

Expert Insights

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest cybersecurity news, threats, and expert insights. Unsubscribe at any time.