Descrizione
An unauthenticated SQL injection can occur on the front end of any site that uses craft.search to perform a search, allowing stacked query execution and enabling escalation to an administrator. Note that this only affects MySQL/MariaDB. Impact * SQL injection — The attribute parameter is concatenated into the query unsanitized, and because PDO runs with emulated prepares, stacked statements execute. This gives unauthenticated read and write access to the application database. * Privilege escalation to administrator — The write primitive was used to set the admin flag on user ID 1 in the users table, confirmed by reading the value back. Craft short-circuits its permission checks on this single column, so no further changes were needed. The same primitive can overwrite any account’s password hash. Update to the patched versions (4.18.9 and 5.11.2) to get the fix. If you cannot update immediately, you can block front-end requests with %5Battribute%5D and [attribute] anywhere in the query string as a temporary mitigation.
Come correggere
Priorità: Alta — pianificare la correzione entro pochi giorni. Motivazione: CVSS 9.8, EPSS 0.5% (percentile 42).
Versioni da aggiornare
- craftcms cms: vulnerabili le versioni dalla
5.0.0precedenti alla5.11.2→ aggiornare alla5.11.2o successiva. - craftcms cms: vulnerabili le versioni dalla
4.0.0precedenti alla4.18.9→ aggiornare alla4.18.9o successiva.
Indicazioni del vendor
Soluzione (testo originale del vendor):
Update to the patched versions (4.18.9 and 5.11.2) to get the fix.
Mitigazioni temporanee
Da applicare solo se non è possibile aggiornare subito:
- Attivare regole WAF anti SQL injection, ridurre i privilegi dell'utente del database e monitorare query anomale.
Verifica
- Individuare tutti gli asset con il prodotto interessato (inventario, scanner di vulnerabilità, CMDB).
- Confrontare la versione installata con quelle indicate sopra.
- Applicare l'aggiornamento in un ambiente di test, poi in produzione; riavviare i servizi se richiesto.
- Ripetere la scansione per confermare la correzione.
Configurazioni interessate
| Vendor | Prodotto | Versioni vulnerabili | Corretta in |
|---|---|---|---|
| craftcms | cms | ≥ 5.0.0 < 5.11.2 | 5.11.2 |
| craftcms | cms | ≥ 4.0.0 < 4.18.9 | 4.18.9 |