GHSA-58xv-7h9r-mx3c: Drupal/drupal Drupal Malicious File Upload With Vulnerability

MODERATE
CWE-434
Published
Advisory Summary

GHSA-58xv-7h9r-mx3c is a MODERATE drupal malicious file upload with vulnerability (CWE-434: Unrestricted Upload of File with Dangerous Type) affecting Drupal/drupal libraries in the Packagist ecosystem. The issue involves drupal malicious file upload with filenames stating with dot. Remediation is available by upgrading affected packages to version 8.7.11, 8.8.1.

GHSA-58xv-7h9r-mx3c at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-58xv-7h9r-mx3c
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-434: Unrestricted Upload of File with Dangerous Type
Affected Product Drupal/drupal
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix GHSA-58xv-7h9r-mx3c

To remediate this vulnerability, upgrade all affected Drupal/drupal 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/drupal fixed: 8.7.11
Upgrade drupal/drupal to 8.7.11
drupal/drupal fixed: 8.8.1
Upgrade drupal/drupal 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/drupal

How to Check if You Are Affected

To determine whether your application is affected by GHSA-58xv-7h9r-mx3c, inspect your project dependencies for Drupal/drupal:

inspect dependencies for drupal/drupal

Analyze the terminal output to locate any version of Drupal/drupal 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/drupal 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-58xv-7h9r-mx3c Affected Drupal/drupal Versions

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

References

Frequently Asked Questions

What is GHSA-58xv-7h9r-mx3c?
GHSA-58xv-7h9r-mx3c is a security vulnerability in Drupal/drupal involving Drupal Malicious file upload with filenames stating with dot under CWE-434: Unrestricted Upload of File with Dangerous Type.
Which Drupal/drupal versions are affected?
Affected versions include releases prior to 8.7.11, 8.8.1 across affected packages: drupal/drupal.
What version fixes GHSA-58xv-7h9r-mx3c?
Upgrading to 8.7.11, 8.8.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is drupal/drupal affected?
Yes, drupal/drupal 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 CWE is associated with GHSA-58xv-7h9r-mx3c?
GHSA-58xv-7h9r-mx3c 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-58xv-7h9r-mx3c?
Run the dependency tree command: 'inspect dependencies for drupal/drupal'. 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-58xv-7h9r-mx3c",
  "modified" : "2024-05-15T20:55:22Z",
  "published" : "2024-05-15T20:55:22Z",
  "aliases" : [ ],
  "summary" : "Drupal Malicious file upload with filenames stating with dot",
  "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.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/drupal"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.7.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/drupal"
    },
    "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/drupal/2019-12-18-2.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/drupal/drupal"
  }, {
    "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:55:22Z",
    "nvd_published_at" : null
  }
}