Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

CustomAlert can survive user deletion and become associated with a recreated login

Aperta
#287 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php
Ambito
backend, database

Direzione di ricerca

Start by reading the CustomAlerts.addAlert flow alongside UsersManager.deleteUser and its cleanup handling. Review CustomAlerts.getAlerts and Processor::shouldBeProcessed to understand how residual alerts become visible after login reuse. Done means a chosen lifecycle or concurrency safeguard prevents the reproduced deletion-and-recreation sequence, with a regression test covering deletion during addAlert.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug triaged

Description

A CustomAlert can remain in the database after its owning user is deleted if an addAlert request completes immediately after the UsersManager.deleteUser cleanup callback.

Because alerts are associated with the textual login value, recreating a user with the same login can make the residual alert visible to the new account once it has access to the same site.

This was previously reported through Matomo's HackerOne program and was assessed as a regular lifecycle bug rather than a security vulnerability. The Matomo team suggested filing it here for hardening.

Root cause

CustomAlerts removes existing alerts when handling UsersManager.deleteUser.

However, an already-authorized CustomAlerts.addAlert request can still complete its database insert after that cleanup has run.

The alert row is associated using the login string rather than an immutable user identity, and there is currently no defensive cleanup when the same login is created again.

Reproduction

Tested locally with:

  • Matomo 5.13.0
  • CustomAlerts 5.3.3
  • self-hosted Docker environment

Sequence:

  1. Create user race-user with access to a test site.
  2. Start a CustomAlerts.addAlert request as that user.
  3. Concurrently delete race-user.
  4. Arrange the interleaving so deletion cleanup executes before the alert insert finishes.
  5. Recreate race-user with a different password/email and restore access to the same site.
  6. Call CustomAlerts.getAlerts.
  7. The newly created account can see the residual alert created by the previous identity.

The behavior was reproduced multiple times in a local environment.

Expected behavior

Deleting a user should guarantee that no alert belonging to the deleted identity can later become associated with a new account that happens to reuse the same login.

Possible fixes

Some possible approaches:

  • associate alerts with an immutable user identifier instead of only the login string;
  • serialize alert creation against user deletion;
  • verify that the same user identity still exists before committing the alert insert;
  • defensively remove residual alerts when a login is created/reused;
  • add a concurrency regression test covering deletion during addAlert.

Additional note

The residual alert is not processed while the login lacks site access, because Processor::shouldBeProcessed() checks current access. The issue is specifically the lifecycle persistence and reassociation of the alert when the same login is later recreated.

Lingua principale
PHP
Stelle
17
Fork
24
Merge medio
1g 6h
PR unite (30g)
7

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di matomo-org/plugin-CustomAlerts

Tutte le issue di matomo-org/plugin-CustomAlerts

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.