Fail2Install: Turning System Limits into Pre-Auth RCE in Drupal Security researchers disclosed a pre-authentication remote code execution flaw in Drupal 8.9, 9, 10 and 11 that works by exhausting system limits such as RLIMIT_NOFILE and converting the resulting EMFILE failures into trusted state, across four deployment combinations: Apache with PostgreSQL, Apache with MySQL, PHP-FPM with PostgreSQL, and PHP-FPM with MySQL. The Drupal vulnerability itself was a duplicate of advisory ANT-2026-GMRPK0BU (SA-CORE-2026-017), reported by Anthropic's OSS Scanner, but the researchers argue their method of leveraging system limits to make the issue exploitable on stock Drupal configurations is novel. The research matters because reaching a limit such as file descriptors, database connections or ephemeral TCP ports is normally treated only as a denial-of-service condition, yet the team showed availability failures can become security primitives. Share on social November 24, 2026 Lorem ipsum The Drupal vulnerability covered in this article ended up being a duplicate of ANT-2026-GMRPK0BU https://www.drupal.org/sa-core-2026-017 , reported by Anthropic's OSS Scanner https://red.anthropic.com/oss-scanner/ . However, we still believe the research we did to leverage system limits and make the issue exploitable on stock Drupal configurations is novel and worth sharing in a dedicated article. Reaching a system limit is usually considered a denial-of-service condition because it directly affects the application's availability. In most cases, running out of file descriptors, database connections, or ephemeral TCP ports simply makes the application, or part of it, unavailable. During this research, we looked at what happens when applications catch these failures and convert them into trusted state. We started with EMFILE , then explored database and TCP limits to determine whether availability failures could become security primitives. Applying this methodology to Drupal uncovered a pre-authentication RCE affecting Drupal 8.9, 9, 10, and 11 across four common deployment combinations: Apache https://hub.docker.com/layers/library/drupal/11.4.11 with PostgreSQL https://hub.docker.com/layers/library/postgres/18.6 , Apache https://hub.docker.com/layers/library/drupal/11.4.11-php8.5-apache with MySQL https://hub.docker.com/layers/library/mysql/8.4 , PHP-FPM https://hub.docker.com/layers/library/drupal/11.4.11-fpm with PostgreSQL https://hub.docker.com/layers/library/postgres/18.6 , and PHP-FPM https://hub.docker.com/layers/library/drupal/11.4.11-fpm with MySQL https://hub.docker.com/layers/library/mysql/8.4 . The first system limitation that caught our attention is RLIMIT NOFILE https://man7.org/linux/man-pages/man2/getrlimit.2.html . It limits how many file descriptors a process can keep open at the same time, including files, sockets, and pipes. This per-process limit has two values: rlim cur : the soft limit currently enforced by the kernel. rlim max : the hard limit, which normally defines the highest soft limit an unprivileged process can set. These two values depend on the init system, service configuration, container runtime, and application. For example, systemd defaults to a 1,024 soft limit https://github.com/systemd/systemd/blob/013e8e46625d0206351a3d77b6d2b693b16a9e62/src/core/system.conf.in L71 and a 524,288 hard limit https://github.com/systemd/systemd/blob/013e8e46625d0206351a3d77b6d2b693b16a9e62/man/systemd.exec.xml L1179 . Since Docker Engine 29.0.0 https://docs.docker.com/engine/release-notes/29/ 2900 , Docker's previous default soft limit of 1,048,576 has been removed, and containers inherit the limits of the containerd service https://github.com/containerd/containerd/blob/5d09e478a09954facbcb4e0d5664fd58287d6751/docs/containerd-2.0.md?plain=1 L118-L125 . It is important to remember that these values are only a baseline. A process can lower its soft limit or raise it up to the hard limit based on its needs. The following table shows examples of the effective limits after several popular runtimes initialize with systemd's default limits: When this limit is reached, operations that create new file descriptors fail with EMFILE: Too many open files . This limitation becomes interesting when it can be reached in an application with a file-access fallback that leads to a default configuration, a default user profile, or anything else that weakens the application's security. For example: python import json from fastapi import FastAPI app = FastAPI files = {} DEFAULT CONFIG = {"requires auth": False} @app.get "/file/{key}" def file key: str : files key = open "data.txt", encoding="utf-8" return files key .read @app.get "/admin" def admin : try: with open "config.json", encoding="utf-8" as config file: config = json.load config file except OSError: config = DEFAULT CONFIG return {"access": "denied" if config "requires auth" else "admin"} Here, requests using unique key values make the global files variable retain file objects between requests. Their file descriptors remain open until the process reaches its RLIMIT NOFILE limit. When EMFILE is then raised while accessing config.json , the application falls back to DEFAULT CONFIG , which disables authentication. Although this is already a promising lead, it has several hard limitations. File descriptors must either persist across requests or accumulate within a single request before the fallback is reached, which is less realistic. This depends heavily on the server and runtime lifecycle. Uvicorn https://github.com/Kludex/uvicorn , for example, can reuse the same Python worker across requests, allowing module-level variables and their file descriptors to persist. In contrast, Apache with mod php creates a new PHP request context for every request and destroys request-scoped variables and resources during shutdown https://github.com/php/php-src/blob/293002ddeaa29f8452800807c63227925c05edf2/Zend/zend.c L1341-L1362 . Finally, the application must catch the resulting error and select an insecure fallback. While the EMFILE error is not as generic as we had hoped, it still highlights the potential of this approach and motivated us to push it further. The second limitation gadget we examined is the database connection limit, commonly exposed as max connections . This configuration defines the maximum number of connections a database can handle at the same time. A quick search for the exact PDO/MySQL error, SQLSTATE HY000 1040 Too many connections , already shows that this limit has much more potential: The major database engines have the following default connection limits: MSSQL is included in the table as another example. In this article, we will focus only on MySQL and PostgreSQL. On the other hand, these are the default concurrency limits for common components used in PHP application deployments: We will focus on PHP in this example to make the explanation easier to follow. The concept remains the same regardless of the language. Based on the table above, we can extract the following simplified condition to determine whether a database connection-limit error, such as the exact PDO/MySQL SQLSTATE HY000 1040 Too many connections error, can be reached: As a simple example, we use an install.php script that checks the database to determine whether the website is already installed. Modern applications commonly expose installation endpoints that allow setup only when checks such as database connectivity, required tables, or configuration files indicate that it is incomplete. For example: WordPress installer https://github.com/WordPress/wordpress-develop/blob/4899c664ee4a54c6d07472412f0db5c3db1c5131/src/wp-admin/install.php , Drupal installer https://github.com/drupal/core/blob/f65cfba81ab20870868c3cee43b4178696071534/install.php , Strapi first-admin setup route https://github.com/strapi/strapi/blob/f2756ab261f89879d3b4aa1921e6216f0df3f87a/packages/core/admin/server/src/routes/authentication.ts L19-L27 ... php try { $database = new PDO 'pgsql:host=db;dbname=app', 'app', 'app', PDO::ATTR ERRMODE = PDO::ERRMODE EXCEPTION, ; $installed = $database- query 'SELECT installed FROM config' - fetchColumn ; } catch PDOException { $installed = false; } header 'Content-Type: application/json' ; echo json encode 'status' = $installed ? 'already installed' : 'start installation', ; If we try to exhaust the database connection limit through this script, the result depends on the PHP deployment and database engine combination: Because PostgreSQL has fewer connection slots by default than Apache has HTTP workers, this is the easiest setup to reproduce with default settings. By sending enough concurrent requests to install.php , we can exhaust the available database connections, trigger the fallback, and start a new website installation: With Apache and MySQL, reaching the connection limit is slightly harder but still possible. Any other endpoint in the same application that opens at least two simultaneous database connections per request can enable the same issue. With PHP-FPM, however, this error gadget becomes significantly less practical. By default, php:8.5-fpm https://hub.docker.com/ /php/tags?name=8.5-fpm runs with only five PHP workers. Reaching MySQL's default connection limit on an otherwise idle database would require each active request to hold at least 31 database connections simultaneously. Specific application behavior or deployment configurations may make this possible, but it becomes far less realistic. While looking for a way to overcome PHP-FPM's worker limit, we came across Linux's handling of TCP TIME WAIT . During a normal TCP shutdown https://www.rfc-editor.org/rfc/rfc9293.html figure-12 , the endpoint that sends the first FIN retains the closed connection tuple in TIME WAIT for about 60 seconds https://github.com/torvalds/linux/blob/65ba8f34ec886ec72b2c07ddc8cf3d815c32869d/include/net/tcp.h L140-L142 . This allows the final ACK to be retransmitted and prevents delayed packets from an old connection from being accepted by a new one. This is why pressing Ctrl+C on a small Python TCP server and immediately restarting it can trigger OSError: Errno 98 Address already in use for about 60 seconds. By default, Linux allocates ephemeral source ports from the 32768–60999 range https://github.com/torvalds/linux/blob/65ba8f34ec886ec72b2c07ddc8cf3d815c32869d/net/ipv4/af inet.c L1781-L1787 , providing 28,232 possible ports. Each TCP connection is identified by a tuple containing the source IP , source port , destination IP , and destination port . Therefore, the same source port can be reused for a different destination because it produces a different tuple, but not for the same destination while the existing tuple remains in TIME WAIT . What happens when no source ports are left for a new PHP-to-database connection? With PDO/MySQL, the next connection attempt raises the exact client error SQLSTATE HY000 2002 Cannot assign requested address . Exhausting the source ports available for a specific database endpoint requires occupying all 28,232 tuples within the 60-second TIME WAIT window. This represents approximately 471 new database connections per second entering PHP-side TIME WAIT . Therefore, sending enough requests to the previous lab is sufficient to reach the installation flow using this technique with any of the following deployment combinations: Here is the result using PHP-FPM with MySQL: Before we get into specific parts of Drupal's /core/install.php https://github.com/drupal/drupal/blob/76deda03b09b57d76941e2d30e6dade35e92a14a/core/install.php code, the following diagram provides a highly simplified overview of the installer: Based on this diagram, we can already see that if the first and second database connections fail, but the third succeeds, the installation begins. Based on what we saw above, it is already quite clear that something might be possible here. If we look more closely at the source code, install verify database settings https://github.com/drupal/drupal/blob/76deda03b09b57d76941e2d30e6dade35e92a14a/core/includes/install.core.inc L1151-L1161 retrieves the stored database credentials and performs the first database connectivity check¹: $install state 'database verified' = install verify database settings $site path ; // ... function install verify database settings $site path { if $database = Database::getConnectionInfo { $database = $database 'default' ; $settings file = './' . $site path . '/settings.php'; $errors = install database errors $database, $settings file ; if empty $errors { return TRUE; } } return FALSE; } It is not clear from this snippet, but behind the scenes, install database errors https://github.com/drupal/drupal/blob/76deda03b09b57d76941e2d30e6dade35e92a14a/core/includes/install.core.inc L1192-L1207 calls the following connect https://github.com/drupal/drupal/blob/76deda03b09b57d76941e2d30e6dade35e92a14a/core/lib/Drupal/Core/Database/Install/Tasks.php L185-L204 function: protected function connect { try { Database::setActiveConnection ; Database::getConnection ; $this- pass 'Drupal can CONNECT to the database ok.' ; } catch \Exception $e { $this- fail / ... / ; return FALSE; } return TRUE; } As we can see, if a SQLSTATE HY000 1040 Too many connections error occurs, $install state 'database verified' is set to FALSE , but the error does not stop the installation process. Next, the second database connectivity check https://github.com/drupal/drupal/blob/76deda03b09b57d76941e2d30e6dade35e92a14a/core/includes/install.core.inc L1170-L1187 ² is where things go wrong: php $existing install = FALSE; if Database::getConnectionInfo { try { $existing install = Database::getConnection - schema - tableExists $table ; } // Do not trigger an error if the database query fails, since the database // might not be set up yet. catch \Exception { } } if $existing install { throw new AlreadyInstalledException \Drupal::service 'string translation' ; } By default, $existing install is set to FALSE , meaning that Drupal has not detected an existing installation at this stage. If the database connection fails, even though credentials were loaded from settings.php https://github.com/drupal/drupal/blob/76deda03b09b57d76941e2d30e6dade35e92a14a/core/lib/Drupal/Core/Site/Settings.php L145-L163 and the previous connection attempt already failed, the exception is ignored and $existing install remains FALSE . Drupal then calls install database errors https://github.com/drupal/drupal/blob/76deda03b09b57d76941e2d30e6dade35e92a14a/core/includes/install.core.inc L2202-L2218 ³ a second time. At this stage, if the connection returns an error, Drupal displays a Requirements problem instead of continuing the installation. php $errors = install database errors $database, $settings file ; if count $errors { $requirements 'database install errors' = 'title' = t 'Database settings' , 'description' = SiteSettingsForm::getDatabaseErrorsTemplate $errors , 'severity' = RequirementSeverity::Error, ; } // ... $severity = RequirementSeverity::maxSeverityFromRequirements $requirements ; if $severity === RequirementSeverity::Error { $build ' title' = t 'Requirements problem' ; $build ' suffix' = t 'Check the messages and