CVE-2022-25277: Drupal/core Drupal Core Arbitrary PHP Code Vulnerability
HIGHCVE-2022-25277 is a HIGH (CVSS 7.2) drupal core arbitrary php code vulnerability (CWE-434: Unrestricted Upload of File with Dangerous Type) affecting Drupal/core libraries in the Packagist ecosystem. The issue involves drupal core arbitrary php code execution. Remediation is available by upgrading affected packages to version 9.3.19, 9.4.3.
CVE-2022-25277 at a Glance
Security Impact
CVSS: 7.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-25277
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.
Upgrade drupal/core to 9.3.19
Upgrade drupal/core to 9.4.3
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 CVE-2022-25277, 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 9.3.19), 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
CVE-2022-25277 Affected Drupal/core Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
drupal/core
|
Packagist |
≥ 8.0.0
< 9.3.19
|
9.3.19
|
|
drupal/core
|
Packagist |
≥ 9.4.0
< 9.4.3
|
9.4.3
|
References
Frequently Asked Questions
What is CVE-2022-25277?
Which Drupal/core versions are affected?
What version fixes CVE-2022-25277?
Is drupal/core affected?
What is the CVSS score of CVE-2022-25277?
What CWE is associated with CVE-2022-25277?
How can I check Packagist dependencies for CVE-2022-25277?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6955-67hm-vjjq",
"modified" : "2023-05-10T00:36:31Z",
"published" : "2022-08-06T09:33:38Z",
"aliases" : [ "CVE-2022-25277" ],
"summary" : "Drupal core arbitrary PHP code execution",
"details" : "Drupal core sanitizes filenames with dangerous extensions upon upload and strips leading and trailing dots from filenames to prevent uploading server configuration files.\n\nHowever, 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.\n\nThis 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "drupal/core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "9.3.19"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "drupal/core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "9.4.0"
}, {
"fixed" : "9.4.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-25277"
}, {
"type" : "WEB",
"url" : "https://github.com/drupal/core/commit/1cd1830d79f221cc8490f53c2bb487dd07094f17"
}, {
"type" : "WEB",
"url" : "https://github.com/drupal/core/commit/5d464ea4407c50e40dcf6cb5ee376e7b8dd36f3a"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/drupal/core/CVE-2022-25277.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/drupal/core"
}, {
"type" : "WEB",
"url" : "https://www.drupal.org/sa-core-2022-014"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-434" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-08-06T09:33:38Z",
"nvd_published_at" : "2023-04-26T15:15:08Z"
}
}