Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2022-25277

Drupal core sanitizes filenames with dangerous extensions upon upload (reference: SA-CORE-2020-012) and strips leading and trailing dots from filenames to prevent uploading server configuration files (reference: SA-CORE-2019-010). However, the protections for these two vulnerabilities previously did not work correctly together. As a result, if the site were configured to allow the upload of files with an htaccess extension, these files' filenames would not be properly sanitized. This could allow bypassing the protections provided by Drupal core's default .htaccess files and possible remote code execution on Apache web servers. This issue is mitigated by the fact that it requires a field administrator to explicitly configure a file field to allow htaccess as an extension (a restricted permission), or a contributed module or custom code that overrides allowed file uploads.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-25277
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 10:08 UTC · Revision 1

Source evidence

CVE-2022-25277

core-osv · Original source

Published 26 Apr 2023, 00:00 UTC

Drupal core sanitizes filenames with dangerous extensions upon upload (reference: SA-CORE-2020-012) and strips leading and trailing dots from filenames to prevent uploading server configuration files (reference: SA-CORE-2019-010). However, the protections for these two vulnerabilities previously did not work correctly together. As a result, if the site were configured to allow the upload of files with an htaccess extension, these files' filenames would not be properly sanitized. This could allow bypassing the protections provided by Drupal core's default .htaccess files and possible remote code execution on Apache web servers. This issue is mitigated by the fact that it requires a field administrator to explicitly configure a file field to allow htaccess as an extension (a restricted permission), or a contributed module or custom code that overrides allowed file uploads.

osv:CVE-2022-25277
Complete source record
{
  "id": "a10c3a51565758f64c23554f2e2c55de117d67d983c62937db5779ce93debfc3",
  "url": "https://osv.dev/vulnerability/CVE-2022-25277",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2022-25277",
    "summary": "Drupal core sanitizes filenames with dangerous extensions upon upload (reference: SA-CORE-2020-012) and strips leading and trailing dots from filenames to prevent uploading server configuration files (reference: SA-CORE-2019-010). However, the protections for these two vulnerabilities previously did not work correctly together. As a result, if the site were configured to allow the upload of files with an htaccess extension, these files' filenames would not be properly sanitized. This could allow bypassing the protections provided by Drupal core's default .htaccess files and possible remote code execution on Apache web servers. This issue is mitigated by the fact that it requires a field administrator to explicitly configure a file field to allow htaccess as an extension (a restricted permission), or a contributed module or custom code that overrides allowed file uploads.",
    "evidence": "osv:CVE-2022-25277",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2022-25277",
      "aliases": [
        "BIT-drupal-2022-25277",
        "CVE-2022-25277",
        "DRUPAL-CORE-2022-014",
        "GHSA-6955-67hm-vjjq"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/drupal/drupal",
              "type": "GIT",
              "events": [
                {
                  "introduced": "35c2f3ca5c935f3d8bde15932a712677c9bbd50f"
                },
                {
                  "fixed": "32680a4aef16035fd6c90014761dcad8de628120"
                },
                {
                  "introduced": "970c1b5cfa946f683de326a3f252b5371a42186a"
                },
                {
                  "fixed": "bf401c8d5c5a88d442ac7e95a9eb059d123a771c"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:drupal:drupal:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "8.0.0"
                      },
                      {
                        "fixed": "9.3.19"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:drupal:drupal:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "9.4.0"
                      },
                      {
                        "fixed": "9.4.3"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "9.3.18",
            "9.4.2",
            "9.3.17",
            "9.4.1",
            "9.4.0",
            "9.3.15",
            "9.3.13",
            "9.3.11",
            "9.3.10",
            "9.3.7",
            "9.3.4",
            "9.3.2",
            "9.3.0",
            "9.3.0-rc1",
            "9.3.0-beta3",
            "9.3.0-beta2",
            "9.3.0-beta1",
            "9.3.0-alpha1",
            "9.0.0-alpha2",
            "9.0.0-alpha1",
            "8.1.0-beta1",
            "8.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-25277.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:27.585267739Z",
      "provider": "osv",
      "references": [
        "https://www.drupal.org/sa-core-2022-014",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/25xxx/CVE-2022-25277.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-25277"
      ],
      "provider_metadata": {
        "cna_assigner": "drupal",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "9.4"
                  },
                  {
                    "fixed": "9.4.3"
                  },
                  {
                    "introduced": "9.3"
                  },
                  {
                    "fixed": "9.3.19"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "StandardRange"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/25xxx/CVE-2022-25277.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-25277",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 494393,
  "published_at": "2023-04-26T00:00:00+00:00"
}