CVE-2022-25277: Malicious File Upload

Published Jul 20, 2022
·
Updated

Drupal core - Critical - Arbitrary PHP code execution - SA-CORE-2022-014

Other sources

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.

Drupal core sanitizes filenames with dangerous extensions upon upload and strips leading and trailing dots from filenames to prevent uploading server configuration files.

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.

Affected Software

5 affected componentsFixes available
composer/drupal/core>=8.9.0, <8.10.0, >=9.0.0, <9.1.0, >=9.1.0, <9.2.0, >=9.2.0, <9.3.0, >=9.3.0, <9.3.19, >=9.4.0, <9.4.3
composer/drupal/core>=9.4.0<9.4.3
9.4.3
composer/drupal/core>=8.0.0<9.3.19
9.3.19
Drupal Drupal>=8.0.0<9.3.19
Drupal Drupal>=9.4.0<9.4.3

Event History

Jul 20, 2022
Advisory Published
06:00 PM
Apr 26, 2023
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionWeakness
Data Sourced
via NVD·03:15 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the vulnerability ID for this Drupal vulnerability?

The vulnerability ID for this Drupal vulnerability is CVE-2022-25277.

2

What is the severity of CVE-2022-25277?

The severity of CVE-2022-25277 is high with a CVSS score of 7.2.

3

How does CVE-2022-25277 affect Drupal?

CVE-2022-25277 affects Drupal versions 8.9.0 up to 8.10.0, 9.0.0 up to 9.1.0, 9.1.0 up to 9.2.0, 9.2.0 up to 9.3.0, 9.3.0 up to 9.3.19, and 9.4.0 up to 9.4.3.

4

What does CVE-2022-25277 allow an attacker to do?

CVE-2022-25277 allows an attacker to execute arbitrary PHP code.

5

How can I fix the vulnerability CVE-2022-25277?

To fix the vulnerability CVE-2022-25277, it is recommended to update Drupal core to a version that includes the patch provided in SA-CORE-2022-014.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203