GHSA-7gwj-7fhm-vw4w: Drupal/core Drupal Core Unrestricted File Upload Vulnerability

MODERATE
CVSS 6.6
CWE-434
Published
Advisory Summary

GHSA-7gwj-7fhm-vw4w is a MODERATE (CVSS 6.6) drupal core unrestricted file upload vulnerability (CWE-434: Unrestricted Upload of File with Dangerous Type) affecting Drupal/core libraries in the Packagist ecosystem. The issue involves drupal core unrestricted file upload. Remediation is available by upgrading affected packages to version 8.7.11, 8.8.1.

GHSA-7gwj-7fhm-vw4w at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-7gwj-7fhm-vw4w
Severity MODERATE
CVSS v3.1 Base Score 6.6
CWE Classification CWE-434: Unrestricted Upload of File with Dangerous Type
Affected Product Drupal/core
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 6.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:L/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity High (I:H)
Availability None (A:N)

How to Fix GHSA-7gwj-7fhm-vw4w

To remediate this vulnerability, upgrade all affected Drupal/core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

drupal/core fixed: 8.7.11
Upgrade drupal/core to 8.7.11
drupal/core fixed: 8.8.1
Upgrade drupal/core to 8.8.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for drupal/core

How to Check if You Are Affected

To determine whether your application is affected by GHSA-7gwj-7fhm-vw4w, inspect your project dependencies for Drupal/core:

inspect dependencies for drupal/core

Analyze the terminal output to locate any version of Drupal/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.7.11), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & RFC 5280 Specification

Under RFC 5280 specifications for X.509 certificates, the Name Constraints extension defines a namespace within which all subsequent subject names in a certification path must be located. Constraints apply to various name forms including directory names, IP addresses, rfc822Name (email addresses), and uniformResourceIdentifier (URI) entries. Specifically, during certificate path validation, affected versions of Drupal/core failed to properly normalize or enforce boundary checks when domain names contained trailing dot (.) characters. Because domain names with a trailing dot signify fully qualified domain names (FQDNs), this omission allowed non-conforming certificates to be improperly validated as compliant with the defined name constraints.

Source Advisory Statement

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.

GHSA-7gwj-7fhm-vw4w Affected Drupal/core Versions

2 component(s)
Fixed Versions:
8.7.118.8.1
Product / Package Ecosystem Affected Versions Fixed Version
drupal/core
Packagist
≥ 8.0.0
< 8.7.11
8.7.11
drupal/core
Packagist
≥ 8.8.0
< 8.8.1
8.8.1

References

Frequently Asked Questions

What is GHSA-7gwj-7fhm-vw4w?
GHSA-7gwj-7fhm-vw4w is a security vulnerability in Drupal/core involving Drupal core unrestricted file upload under CWE-434: Unrestricted Upload of File with Dangerous Type.
Which Drupal/core versions are affected?
Affected versions include releases prior to 8.7.11, 8.8.1 across affected packages: drupal/core.
What version fixes GHSA-7gwj-7fhm-vw4w?
Upgrading to 8.7.11, 8.8.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is drupal/core affected?
Yes, drupal/core is affected in releases prior to 8.7.11, 8.8.1. Upgrade your dependency to 8.7.11, 8.8.1 or later.
What is the CVSS score of GHSA-7gwj-7fhm-vw4w?
GHSA-7gwj-7fhm-vw4w has a CVSS v3.1 base score of 6.6 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:L/I:H/A:N.
What CWE is associated with GHSA-7gwj-7fhm-vw4w?
GHSA-7gwj-7fhm-vw4w is classified under CWE-434: Unrestricted Upload of File with Dangerous Type (The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.).
How can I check Packagist dependencies for GHSA-7gwj-7fhm-vw4w?
Run the dependency tree command: 'inspect dependencies for drupal/core'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7gwj-7fhm-vw4w",
  "modified" : "2024-05-15T20:43:00Z",
  "published" : "2024-05-15T20:43:00Z",
  "aliases" : [ ],
  "summary" : "Drupal core unrestricted file upload",
  "details" : "Drupal 8 core's file_save_upload() function does not strip the leading and trailing dot ('.') from filenames, like Drupal 7 did.\n\nUsers 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.\n\nAfter this fix, file_save_upload() now trims leading and trailing dots from filenames.\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:L/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.7.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.8.0"
      }, {
        "fixed" : "8.8.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/drupal/core/2019-12-18-2.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/drupal/core"
  }, {
    "type" : "WEB",
    "url" : "https://www.drupal.org/sa-core-2019-010"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-434" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-15T20:43:00Z",
    "nvd_published_at" : null
  }
}