Drupal install.php: how to block and verify it after SA-CORE-2026-017
How to patch CVE-2026-132165, block Drupal's /core/install.php in Apache or Nginx, and verify it on production, staging and container builds.
This guide is for Drupal operators who run production, staging or containerised sites on Drupal 10.6 or 11.3/11.4 and need to confirm the installer cannot be reached after deployment. It is based on Drupal's official documentation and advisory; we have not run these steps ourselves. By the end you will have patched, blocked /core/install.php at the web server, and checked the result with three curl requests.
Threat model
Drupal core ships an installer at /core/install.php. In SA-CORE-2026-017 (CVE-2026-132165, published 18 November 2026), the Drupal Security Team says that under specific conditions an attacker can use the installer to attempt to reinstall Drupal, leading to site takeover or remote code execution. Drupal later rated it highly critical (20/25) and added that a report says it was exploited on live sites as early as 2026-11-19 19:00 UTC. SecurityWeek reports CISA added it to the KEV catalog on 24 November with a federal due date of 27 November.
The attacker is unauthenticated and remote. The asset at risk is any copy of Drupal where the installer route answers: production, a staging clone, or a container image.
Affected versions per the advisory: below 10.6.22, 11.0.0 up to below 11.3.22, and 11.4.0 up to below 11.4.13. Drupal 11.2.x and older, 10.5.x and older, 8 and 9 are end-of-life and get no fix.
The advisory says some, but not all, exploit paths are mitigated if the web server cannot write to or change permissions on settings.php. It recommends upgrading and also securing the installer. Drupal Steward customers are protected from known vectors but are still told to upgrade.
Step 1: Patch
The advisory's initial fixes for this CVE were 11.4.13, 11.3.22 and 10.6.22. Do not treat those as final targets: Drupal's release listing labels 11.3.22 "Security update / Insecure" and the capture does not explain why, so move to the latest supported security release on your branch and check the current release advisories. Drupal's release page for 11.3.22 lists these Composer commands:
composer update "drupal/core-*" --with-all-dependencies
The same page lists 11.3.23 and 11.4.14 (25 November 2026) as later releases. Its release notes also document a theme-registry regression in this release line and say it was expected to be fixed in 11.4.14; we have not confirmed that the fix shipped, so read the known issues before choosing a target.
Success: the status report shows a fixed version. Common failure: a pinned drupal/core-recommended; use the pinned composer require form from the release page.
Patching does not remove the need for the next steps, because Drupal's own documentation says that if you have already installed, you do not need the installer at all and can remove the risk of future installer bugs.
Step 2: Block the route at the web server (recommended)
Drupal's Securing the installer page recommends this as Option 1 because it survives core updates.
Apache: put this in server or virtual host configuration, not .htaccess (that causes a 500 error), then reload:
<Location "/core/install.php">
Require all denied
</Location>
Use apachectl -S to find the virtual host files and add the rule to each one serving the site, including the HTTPS one. Run apachectl configtest first. For a subdirectory install, change the path, for example /drupal/core/install.php.
Nginx: in the HTTPS server block (find it with nginx -T):
location ^~ /core/install.php {
return 404;
}
The docs say to use ^~, not an exact match (location = ...). Some configurations send any URL containing .php/ to PHP, so an exact match would leave /core/install.php/foo running the installer. Run nginx -t before reloading.
Failure mode: a rule added to only one virtual host, or a managed host that already blocks the installer. The docs say to test before adding your own rule.
Step 3: Shared hosting only, .htaccess
If you cannot edit server config, the documented Apache-only option is:
<Files "install.php">
Require all denied
</Files>
This needs AllowOverride to include AuthConfig, which Drupal normally already requires. The catch for CI and deployments: .htaccess is a scaffold file, and Composer replaces it on every scaffold run, including plain composer install. Hand edits vanish. The docs say to keep the lines in a separate file (their example is assets/htaccess-additions.txt) and append them via composer.json:
"extra": {
"drupal-scaffold": {
"file-mapping": {
"[web-root]/.htaccess": {
"append": "assets/htaccess-additions.txt"
}
}
}
}
Then run composer update --lock and composer install, and check the lines sit at the end of .htaccess.
Step 4: Optionally remove the file, as a second layer
Documented Composer scripts delete the file after each install or update, because Composer restores it:
"scripts": {
"post-install-cmd": ["rm -f web/core/install.php"],
"post-update-cmd": ["rm -f web/core/install.php"]
}
Change web/ if your web root differs. Documented limits: composer install --no-scripts leaves the file in place, you cannot browser-install a new site until it is restored, and rm -f needs a Unix-style shell on Windows. The docs recommend combining this with Step 2 or 3, since each covers the other's failure: a --no-scripts build keeps the file, while a web server rule can be dropped in a config change or migration.
Staging copies, containers and CI images
The documentation does not give container-specific instructions, so this section applies its stated failure modes; treat it as our reading, not Drupal guidance. The checks that follow from the docs:
- If your image build runs
composer install --no-scripts, the Step 4 removal never runs. Either drop the flag or rely on a web server rule. - If you rely on
.htaccess, confirm the appended lines survive the build's scaffold step. - The web server rule lives in server configuration, so it must be in whatever config the image or staging host actually loads, and in every virtual host or
serverblock that serves the site. - A platform or server migration can silently drop the rule, which is the reason the docs recommend two layers.
- Run the verification below against each environment's real URL, not only production.
The release notes add one behaviour change: if settings.php is not writable during installation, the installer now shows an error instead of fixing permissions itself. That affects new installs only, so pipelines that rely on the installer adjusting permissions will need to set them beforehand. Existing sites are unaffected.
If you need the installer later, for example for a multisite addition, the docs say to allow access briefly (the Apache page shows a Require ip variant) or use drush site:install, which does not use install.php.
Verify
Drupal's documented check, with your hostname substituted:
curl -I https://example.com/core/install.php
curl -IL https://example.com/install.php
curl -I https://example.com/core/install.php/foo
All three should end in 403 or 404. A 200 means the block is not working. The third request matters on Nginx because of the path-info case above. Then confirm the site works and that drush updatedb or /update.php still runs; update.php is a separate script and a broad rule can block it by accident.
Drupal's documentation navigation lists a separate page titled "Checking whether your site was compromised through the installer"; we could not verify its URL or contents. Given exploitation reported from 19 November, sites that were exposed before patching should look for it on drupal.org.
Roll back
Remove the Location or location block and reload (apachectl configtest or nginx -t first). For the .htaccess option, remove the rules from the separate additions file or remove the scaffold append mapping from composer.json, update the lock file as appropriate (composer update --lock), and then run Composer; deleting only the generated lines in .htaccess lets the scaffold step append them again. If you removed the file, it must be restored before you can install in the browser; the documentation does not specify a verified restoration procedure. Rolling back the Drupal core update itself is not advisable on affected versions.
What is not known
SecurityWeek says no public information appears to be available on the attacks, and the exact conditions required to exploit the flaw have not been published in the advisory. Which exploit paths settings.php permissions do and do not cover is also unspecified, so do not treat file permissions as a substitute for patching and blocking.
Comments ()