# Setup state lost on transient errors

Setup/install guards that treat errors or empty params as 'not installed', reopening privileged actions

_Area: Web business logic and race conditions. Seen in 2 disclosed reports; latest 2026-11-25. Updated 2026-11-29._

## How it works
A guard decides whether the app is already installed by probing state (a DB connection, a cache entry, a request parameter). When the probe fails transiently — connection refused, timeout, null, empty string — the code treats that as "no state exists" and falls into the fresh-install or not-found branch. That branch reopens setup actions (create admin, write config, upload files) that should be unreachable on a live system. The broken assumption: "error" and "absent" are the same thing. They are not; an error means unknown, and unknown must fail closed.

## Where it shows up
- Installer/setup code that catches DB or filesystem exceptions and continues instead of aborting [E2](https://bugbountylibrary.com/r/blog%3Astepsecurity-io-blog-fail2install-cve-2026-132165.md)
- A later, stricter check (requirements page) that would abort, but runs after the permissive early probe [E2](https://bugbountylibrary.com/r/blog%3Astepsecurity-io-blog-fail2install-cve-2026-132165.md)
- Guard conditions combining a parameter check with a state check using `&&` where `||` was meant, so a non-empty parameter skips the redirect [E3](https://bugbountylibrary.com/r/blog%3Aassetnote-io-resources-research-logic-flaw-leading-to-rce-in-dynamicweb-9-5-0-9-12-7.md)
- Caches or dedup sets keyed by a hash that does not commit to the full object, inserted before validation and never removed on failure [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-4m69-67m6-prqp.md)
- Setup endpoints reachable anonymously with no separate "already installed" lock [E2](https://bugbountylibrary.com/r/blog%3Astepsecurity-io-blog-fail2install-cve-2026-132165.md)[E3](https://bugbountylibrary.com/r/blog%3Aassetnote-io-resources-research-logic-flaw-leading-to-rce-in-dynamicweb-9-5-0-9-12-7.md)

## How to review
Find every place the code asks "is this installed / seen / valid?" and check what happens on error, null, or empty input. The invariant: any failure to positively confirm state must take the same path as "state exists" (deny, redirect, abort), never the fresh-install path. For guards, read the boolean literally: does a populated parameter bypass the completed-setup check? For caches, confirm the key commits to the whole body and that entries are removed when the write or validation fails [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-4m69-67m6-prqp.md).

## How finders spotted it
- Noticed early DB checks swallow connection errors while the aborting requirements check runs later, then hypothesized a race where the DB refuses early and accepts later connections within one request [E2](https://bugbountylibrary.com/r/blog%3Astepsecurity-io-blog-fail2install-cve-2026-132165.md)
- Read the setup `Page_Load` guard and saw `IsNullOrEmpty(Action) && SetupCompleted()` meant a populated `Action` skips the redirect; traced `Action` into `HandleAction` to list reachable operations [E3](https://bugbountylibrary.com/r/blog%3Aassetnote-io-resources-research-logic-flaw-leading-to-rce-in-dynamicweb-9-5-0-9-12-7.md)
- Reasoned from hash-commitment analysis that two bodies can share a header hash, then cross-referenced another implementation and confirmed with an end-to-end reproduction and a control experiment [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-4m69-67m6-prqp.md)

## Variants seen
- Transient DB connection failure read as "not installed", reopening install.php [E2](https://bugbountylibrary.com/r/blog%3Astepsecurity-io-blog-fail2install-cve-2026-132165.md)
- Boolean operator error in a setup guard letting a parameter bypass the completed check [E3](https://bugbountylibrary.com/r/blog%3Aassetnote-io-resources-research-logic-flaw-leading-to-rce-in-dynamicweb-9-5-0-9-12-7.md)
- Dedup cache poisoned by a rejected variant of a valid object, blocking the valid one [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-4m69-67m6-prqp.md)
- Pruned-fork hashes left cached, locking out their children [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-4m69-67m6-prqp.md)

## Impact and severity
Reinstall grants admin, chained to a file-upload suffix bypass for arbitrary code execution and credential/hash-salt theft [E2](https://bugbountylibrary.com/r/blog%3Astepsecurity-io-blog-fail2install-cve-2026-132165.md). Setup re-run creates an admin and uploads a webshell for RCE [E3](https://bugbountylibrary.com/r/blog%3Aassetnote-io-resources-research-logic-flaw-leading-to-rce-in-dynamicweb-9-5-0-9-12-7.md). Cache poisoning stalls block sync and keeps a node permanently diverged; sustained repetition scales it [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-4m69-67m6-prqp.md). Severity rises with anonymity of the endpoint and chaining to code execution.

## Seen in real software
Open-source packages and projects, and products, where this pattern was found. If the target runs one, compare the version it runs with the fix.
- **Drupal** (core installer (core/install.php)) Drupal 10 before 10.6.22, 11.0.0 through 11.3.21, and 11.4.0, fixed in Drupal 10.6.22, 11.3.22, and 11.4.13: Fail2Install (CVE-2026-132165): Drupal Installer Flaw Lets Attackers Take Over Sites and Run Code (CVE-2026-132165). Report: https://bugbountylibrary.com/r/blog%3Astepsecurity-io-blog-fail2install-cve-2026-132165.md
- **Dynamicweb** (Admin/Access/Setup/Default.aspx) 9.5.0 - 9.12.7: Logic Flaw Leading to RCE in Dynamicweb 9.5.0 - 9.12.7 (CVE-2022-25369). Report: https://bugbountylibrary.com/r/blog%3Aassetnote-io-resources-research-logic-flaw-leading-to-rce-in-dynamicweb-9-5-0-9-12-7.md

## Evidence
- E1: https://bugbountylibrary.com/r/ghsa%3AGHSA-4m69-67m6-prqp.md
- E2: https://bugbountylibrary.com/r/blog%3Astepsecurity-io-blog-fail2install-cve-2026-132165.md
- E3: https://bugbountylibrary.com/r/blog%3Aassetnote-io-resources-research-logic-flaw-leading-to-rce-in-dynamicweb-9-5-0-9-12-7.md
