GHSA-5FV7-WH8Q-CMFJ
Modoboa Credential PDF Path Traversal
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 2.13.0 | modoboa · -4 d desde divulgación | |
| Divulgación | Publicada | GHSA-5FV7-WH8Q-CMFJ divulgada · CVSS 7.6 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Modoboa stores credential PDFs in a shared storage directory using a filename
derived from the account's mutable `username` field. `get_creds_filename()`
only checks that the resolved path stays inside the storage directory; it does
not verify that the file belongs to the account being authorized
Details
A privileged account without a mailbox (DomainAdmin or Reseller) can rename
itself to a path-like value such as `x/../<victim>`. The account update path
skips e-mail/domain validation whenever the request body has no `mailbox` key,
so the value is persisted. The attacker then calls
`GET /api/v2/credentials/<own_id>/`; authorization passes on the attacker's own
account, while `os.path.abspath` collapses `x/../victim` to
`<storage_dir>/victim.pdf`. The server decrypts that file and returns it.
The chain was confirmed end to end in the lab: the attacker received the
victim's decrypted PDF byte for byte (2557 bytes, matching SHA-256,
`Content-Disposition: attachment; filename="reseller@tenant-a.test.pdf"`).
Proof of concept
PATCH /api/v2/accounts/{{account_id}}/ HTTP/1.1
Host: {{host}}
Authorization: Bearer {{token}}
Content-Type: application/json
{"username": "x/../{{victim_username}}"}GET /api/v2/credentials/{{account_id}}/ HTTP/1.1
Host: {{host}}
Authorization: Bearer {{token}}- `{{account_id}}` is the attacker's own account.
- Do not send `Accept: application/pdf` in the second request; DRF returns 406.
- Expected: `200`, `Content-Type: application/pdf`, and
- With the default `delete_first_dl=True`, the file is deleted after download.
Impact
plaintext usernames and passwords of any account whose username is
known and whose document still exists. If the victim is a Reseller or another
tenant's administrator, this becomes cross-tenant privilege escalation and
account takeover. With the default `delete_first_dl=True`, the read is
one-shot and also destroys the victim's document
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 |
|---|---|---|---|---|
pypimodoboa |
Corregida | 2.13.0 | -4 d | 2.13.0 no afectada |
2.13.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/modoboa/modoboa/security/advisories/GHSA-5fv7-wh8q-cmfjLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
