GHSA-6X8J-28P6-MMFM
Installer step endpoints accept a pre-install session after setup, allowing settings.php to be rewritten
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-6X8J-28P6-MMFM divulgada · CVSS 7.5 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
After TeamPass was installed, the installation wizard's step endpoints (`public/install/install-steps/run.step1.php` to `run.step6.php`) still accepted an install session opened on `install.php` before the setup finished. Such a session could call every step on the live instance. That includes `run.step6.php`, which rewrites `app/config/settings.php`. The fix for GHSA-8xp7-fh3p-5pcr left this gap.
Details
Since 3.2.3.1, `install.php` creates an install grant and a CSRF token in a PHP session. Once `app/config/settings.php` exists, it refuses to load (`public/install/install.php:47-59`). `installAssertStepAuthorized()` is the guard that every step endpoint calls (`public/install/install-steps/install.functions.php:88-117`). It checked only the grant and the CSRF token. It never checked whether the instance was already installed, and nothing revoked the grant when the installation completed. A session opened before the setup finished therefore kept access to every step after go-live.
With such a session, a requester could:
- Take over the instance. `run.step6.php` (`settingsFile`) overwrites `app/config/settings.php` with the database connection parameters sent in the request. The live instance can therefore be pointed at a database server the requester controls.
- Make every stored secret unreadable. The same action can write a new encryption key file into `settings.php`. All stored secrets then stay undecryptable until an administrator restores the previous `settings.php`.
- Reset the `admin` password. Given the live database credentials, `run.step4.php` and `run.step5.php` can be replayed against the live database, which resets the password of the `admin` account.
A second defect widened the exposure. Since 3.2.3.1, the same "already installed" check also refused the wizard's final page (step 7). That page's button deletes the `install` directory and clears the database credentials the wizard keeps in the browser's local storage, but it was never shown. As a result, the `install` directory stayed reachable after a web installation unless someone removed it by hand. The Docker image removes it at the next container start.
Preconditions
- The instance was installed (not upgraded) with 3.2.3.1, 3.2.3.2 or 3.2.3.3. Upgraded instances never go through the not-installed window in which a grant can be obtained.
- The attacker obtained an install session before the setup finished. They either loaded `install.php` while the new instance was reachable but not yet installed, or had access to the browser used for the installation. Periodic requests to a step endpoint keep the session alive.
- `public/install/` is still served after the installation.
- PHP can write to `app/config/`. This is always true during the installation, and true by default in the Docker image.
The takeover path needs no credentials for the installed instance.
Impact
An attacker can rewrite `app/config/settings.php` on a live instance. This leads either to a full takeover of the application, by pointing it at an attacker-controlled database, or to the loss of access to all stored secrets.
Patches
Fixed in 3.2.3.4:
- Once `settings.php` exists, the step endpoints refuse every install session except the one that wrote that file. That session may run step 6 only, and only while the file on disk still matches the SHA-256 recorded when it was written.
- The install grant is revoked when the installation completes.
- The name of the encryption key file written into `settings.php` must be a plain file name.
- The installing session sees the final page again, so the `install` directory is deleted and the database credentials stored in the browser are cleared.
Workarounds
- After installing, delete `public/install/` (keep a copy for future upgrades) or deny HTTP access to it. On Apache, enable `Require all denied` in `public/install/.htaccess`; on other servers, use the equivalent rule.
- After installing, make `app/config/` read-only for the web server user.
- Run the installation while the server is not reachable from untrusted networks.
Indicators of compromise
- A file `app/config/settings.php.<YYYY_MM_DD_HHMMSS>.bak` timestamped after the installation. The installer creates it only when it overwrites an existing `settings.php`.
- `DB_HOST`, `DB_NAME` or `SECUREFILE` in `app/config/settings.php` differ from what you configured, or `secrets/` holds more than one key file.
- An `_install` table in the TeamPass database after the installation.
- Web server logs showing POST requests to `/install/install-steps/run.step*.php` after the installation date.
Relationship to GHSA-8xp7-fh3p-5pcr
Versions up to 3.2.3.0 are affected by GHSA-8xp7-fh3p-5pcr. That advisory is critical: on those versions, the step endpoints required no session at all. Upgrade to 3.2.3.4 or later in all cases.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistnilsteampassnet/teampass |
Corregida | 3.2.4.0 | — | — |
3.2.4.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/nilsteampassnet/TeamPass/security/advisories/GHSA-6x8j-28p6-mmfmLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
