Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. drupal/core
  4. ›
  5. GHSA-7gwj-7fhm-vw4w

GHSA-7gwj-7fhm-vw4w: Drupal core unrestricted file upload

May 15, 2024

Drupal 8 core’s file_save_upload() function does not strip the leading and trailing dot (’.’) from filenames, like Drupal 7 did.

Users with the ability to upload files with any extension in conjunction with contributed modules may be able to use this to upload system files such as .htaccess in order to bypass protections afforded by Drupal’s default .htaccess file.

After this fix, file_save_upload() now trims leading and trailing dots from filenames.

References

  • github.com/FriendsOfPHP/security-advisories/blob/master/drupal/core/2019-12-18-2.yaml
  • github.com/advisories/GHSA-7gwj-7fhm-vw4w
  • github.com/drupal/core
  • www.drupal.org/sa-core-2019-010

Code Behaviors & Features

Detect and mitigate GHSA-7gwj-7fhm-vw4w with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 8.0.0 before 8.7.11, all versions starting from 8.8.0 before 8.8.1

Fixed versions

  • 8.7.11
  • 8.8.1

Solution

Upgrade to versions 8.7.11, 8.8.1 or above.

Impact 6.6 MEDIUM

CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:L/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-434: Unrestricted Upload of File with Dangerous Type

Source file

packagist/drupal/core/GHSA-7gwj-7fhm-vw4w.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:38 +0000.