GHSA-4HRH-WJP5-WRPH
history_entry_add injects arbitrary history into restricted items (audit-log forgery)
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-4HRH-WJP5-WRPH divulgada · CVSS 5.4 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The `history_entry_add` action of `app/sources/items.queries.php`, which adds a manual entry to an item's history, did not check the caller's rights on the item. A folder member excluded from an item by a role restriction, a read-only member, or an administrator could write entries with any text and any date into that item's audit history. The answer also returned the item's newest history entry, whoever had written it, which handed the caller an entry of an item they were not allowed to read.
Details
Paths and line numbers are those of 3.2.4.4.
- `history_entry_add` (`:7289`) checks that the item's folder is in the caller's session folder list and that the caller is not left out of the item's user list (`restricted_to`).
- A restriction by role is stored in `restriction_to_roles` alone and leaves `restricted_to` empty, so the handler treats the item as unrestricted. It never checks edit rights either, so members with read-only rights on the folder and read-only accounts pass it too, and so do administrators, who have no item access in TeamPass by design, on every shared item without a user list.
- The *Manual insertions in item history log allowed* setting, off by default, was checked by the Items page only. The handler accepted the request with the feature disabled.
- After writing the entry, the handler read back the item's newest `log_items` row by date and returned it to the caller. The `date` column is stored as text, so the row returned depends on the date the caller submits: an invalid date returns the item's latest real entry.
An entry is always recorded under the caller's own account, so it cannot pass for another user's action. Its text and date are free. The handler has had this guard since 3.0.0.0.
The read side of the same history (`load_item_history`) applies the restrictions since 3.2.4.1 (GHSA-75qw-h7p8-ppr3). This write path was not covered by that fix.
Proof of concept
Fixture: folder `Shared` (id 1) shared with role `TeamA`; users `owner` and `attacker`, both in `TeamA`; item 2 `SECRET-ROLE-XYZ` restricted to role `Finance`, with *restricted to roles* enabled.
- Control: as `attacker`, `show_details_item` on item 2 returns `show_details: 0`, and `load_item_history` and `show_opt_code` return "You are not allowed to access this folder". The restriction holds.
- As `attacker`, post `type=history_entry_add` to `sources/items.queries.php` with `{"item_id": 2, "label": "ATTACKER-FAKE-HISTORY", "date": "01/01/2026", "time": "12:00"}`. The answer is `{'error': '', 'new_line': '<br>20/11/2026 22:23:19 - attacker - Access requested - '}`: the newest entry of the item, not the one just written.
- `log_items` now holds an `at_manual` row for item 2 with the text `ATTACKER-FAKE-HISTORY`, dated 2026-01-01.
Impact
- Integrity: entries with a chosen text and a backdated date are added to the audit history of items the caller cannot edit, including items they cannot read. Administrators and item owners rely on that history to review changes and access.
- Confidentiality: the caller receives the newest history entry of an item they are not allowed to read.
Patches
Fixed in 3.2.4.5. Before writing an entry, the handler:
- refuses the request unless *Manual insertions in item history log allowed* is enabled;
- refuses a deleted, inactive or missing item;
- requires edit rights on the item through `getCurrentAccessRights()`, the same rights resolution as saving the item: folder scope, read-only status, personal folders, user and role restrictions, no item access for administrators. No edition lock is taken.
The answer no longer reads the history back: it only says whether the entry was written.
Workarounds
None short of upgrading. Disabling *Manual insertions in item history log allowed* does not help, since the handler did not check it.
Credits
Reported by Aditay Kumar (`adityasunny06help-coder`).
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
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.5 | — | — |
3.2.4.5Arsenal 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-4hrh-wjp5-wrphLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
