GHSA-7GH7-QH7C-9R8M
Admin config-read API endpoints (LDAP, Elasticsearch, OpenSearch, dashboard) are gated by login only, not CONFIGURATION_EDIT
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-7GH7-QH7C-9R8M divulgada · CVSS 4.3 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Admin config-read API endpoints (LDAP, Elasticsearch, OpenSearch, dashboard) are gated by login only, not CONFIGURATION_EDIT
Affected versions and vulnerable location
- Confirmed on default branch `main` at `5d4a975cdc53dca26383f2b8a56596b1272fcac2` (tag `4.1-nightly-2026-07-30`).
- Strongest instance (LDAP server configuration):
- `phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/LdapController.php:30` route `GET admin/api/ldap/configuration`, guard at `:33` is `userIsAuthenticated()` only.
- `phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/LdapController.php:62` route `GET admin/api/ldap/healthcheck`, guard at `:64` is `userIsAuthenticated()` only.
- Same-class siblings:
- `phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/ElasticsearchController.php:117` (`statistics`) and `:140` (`healthcheck`), guarded by `userIsAuthenticated()`, while the write methods in the same file at `:52`, `:70`, `:88` correctly require `PermissionType::CONFIGURATION_EDIT`.
- `phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/OpenSearchController.php:114` (`statistics`) and `:132` (`healthcheck`), same asymmetry against the write methods at `:49`, `:67`, `:85`.
- `phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/DashboardController.php` read routes `dashboard/verify` (`:142`), `dashboard/visits` (`:205`), `dashboard/topten` (`:224`), `dashboard/searches` (`:297`), `dashboard/content-health` (`:312`), all `userIsAuthenticated()` only.
Why this is reachable by a non-admin
phpMyFAQ has no global admin gate on the `admin.api.*` routes. `AbstractController::userIsAuthenticated()` enforces only that a session is logged in (`isLoggedIn()`), with no permission bit. There is no kernel listener that checks admin rights for the admin API namespace, so each endpoint's only authorization is whatever its own body calls. An ordinary account (front-end self-registration, or any admin user holding an unrelated granular permission) is "authenticated" and therefore passes `userIsAuthenticated()`.
This is the identical premise the maintainer already accepted in two published advisories: GHSA-jrc5-w569-h7h5 ("Ordinary Authenticated User Can Access Admin-Only API Endpoints") and GHSA-rm98-82fr-mcfx ("Missing CONFIGURATION_EDIT Permission Check on 12 Admin API Configuration Tab Endpoints Allows Information Disclosure by Any Authenticated User"). The endpoints below are read siblings that were not covered by that fix: their mutating counterparts in the same controllers were correctly raised to `CONFIGURATION_EDIT`, but the read methods were left at `userIsAuthenticated()`.
What each endpoint leaks
- `admin/api/ldap/configuration`: returns `getLdapServer()`, `getLdapMapping()`, `getLdapOptions()`, `getLdapGroupConfig()` and general LDAP settings. Only `ldap_password` is masked to `********` (`LdapController.php:36-41`). The bind account name `ldap_user`, the directory host `ldap_server`, `ldap_port`, and the search base `ldap_base` are returned in cleartext. That is internal directory topology and a bind DN, useful reconnaissance for attacking the organization's AD/LDAP.
- `admin/api/ldap/healthcheck`: performs a live `Ldap::connect()` bind against every configured server and returns per-server reachability plus `$ldap->error` strings. Lets any authenticated user force outbound bind attempts to admin-configured hosts and read connection-error detail.
- `admin/api/elasticsearch/statistics` and `admin/api/opensearch/statistics`: return the index name and the full `indices().stats()` payload (document counts, store sizes, shard internals).
- `elasticsearch/healthcheck`, `opensearch/healthcheck`: cluster reachability/health for the configured backend.
- `dashboard/verify`: runs the remote file-integrity verification and returns the list of verification issues. `dashboard/visits`, `topten`, `searches`, `content-health`: aggregate site analytics and content-health counters intended for administrators.
Reachability trace verified on default branch
- Authenticate as any account with a valid session (no admin permission required).
- `GET admin/api/ldap/configuration` -> `LdapController::configuration()` -> `userIsAuthenticated()` passes -> returns the LDAP server array with only the password masked.
- The same login reaches every endpoint listed above; each performs only the login check before returning admin data or triggering the backend probe.
Reproduction
Source-verified. No runtime request was executed against a live instance in this pass. Command output confirming the guard asymmetry:
rg -n "Route\(path:|userIsAuthenticated|userHasPermission\(PermissionType::CONFIGURATION_EDIT" \
phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/LdapController.php \
phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/ElasticsearchController.php \
phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/OpenSearchController.phpObserved (abridged):
LdapController.php:30: Route(path: 'ldap/configuration' ...)
LdapController.php:33: $this->userIsAuthenticated();
ElasticsearchController.php:88: $this->userHasPermission(PermissionType::CONFIGURATION_EDIT); // write: gated
ElasticsearchController.php:117: $this->userIsAuthenticated(); // statistics: login only
OpenSearchController.php:85: $this->userHasPermission(PermissionType::CONFIGURATION_EDIT); // write: gated
OpenSearchController.php:114: $this->userIsAuthenticated(); // statistics: login onlyIndependent re-verification at HEAD (2026-07-31)
Re-checked against phpMyFAQ HEAD `2c67e12`. The read/write asymmetry is intact, and `ElasticsearchController.php`
shows it inside a single file:
50: public function create() -> 52: userHasPermission(PermissionType::CONFIGURATION_EDIT)
68: public function drop() -> 70: userHasPermission(PermissionType::CONFIGURATION_EDIT)
86: public function import() -> 88: userHasPermission(PermissionType::CONFIGURATION_EDIT)
115: public function statistics() -> 117: userIsAuthenticated()
138: public function healthcheck() -> 140: userIsAuthenticated()Three mutating methods correctly require `CONFIGURATION_EDIT`; the two read methods beside them require only
a session. That is the same shape in `OpenSearchController.php`.
For the LDAP endpoint the leak is worth quoting exactly, because the masking makes it look handled at a
glance. `LdapController.php:30` onward:
$this->userIsAuthenticated();
$servers = $this->configuration->getLdapServer();
$strippedServers = array_map(
static function (array $server): array {
$server['ldap_password'] = '********';
return $server;
},
$servers,
);Only `ldap_password` is replaced. The rest of each server record, including `ldap_server`, `ldap_port`,
`ldap_user` (the bind account) and `ldap_base` (the search base), is returned verbatim, alongside
`getLdapMapping()`, `getLdapOptions()` and `getLdapGroupConfig()`. Someone reviewing this quickly could
conclude the endpoint is already sanitised; it sanitises one field out of the record.
Suggested fix
Replace `userIsAuthenticated()` with `userHasPermission(PermissionType::CONFIGURATION_EDIT)` on the LDAP `configuration`/`healthcheck` and the Elasticsearch/OpenSearch `statistics`/`healthcheck` read methods, matching the write methods already present in the same controllers. Gate the dashboard read endpoints on an appropriate admin permission (for example a statistics/dashboard-view right) rather than bare login. For `ldap/configuration`, also consider masking or omitting `ldap_user` alongside the password, since the bind account name is sensitive on its own.
Severity and CVSS reasoning
Suggested severity: Medium (consistent with the sibling advisory GHSA-rm98).
Suggested CVSS:3.1 vector: `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N` (3.1).
- `PR:L`: requires any authenticated account, but not the admin permission the data is meant to be behind.
- `C:L`: internal directory topology, a bind DN, and search-index internals are disclosed; the LDAP password itself stays masked, so confidentiality impact is limited rather than high.
- `I:N/A:N`: read-only endpoints (the `healthcheck` probes trigger outbound connections but do not alter application state).
The CVSS base lands in the Low band, but I flag it Medium to match the maintainer's rating of the same missing-`CONFIGURATION_EDIT` class in GHSA-rm98 and because the LDAP bind DN plus directory host is materially more sensitive than a generic config value.
How I found it and a note on tooling
I enumerated every route in the three admin config API controllers and compared the guard on each read method against the guard on its mutating sibling in the same file. The write paths uniformly require `CONFIGURATION_EDIT`; the read paths do not, which is the same gap class the maintainer previously fixed for the configuration-tab endpoints. I used AI assistance for enumeration and drafting and manually verified the routes, guards, and returned fields at HEAD. Verification is source-only; I did not issue live requests against a running instance.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistphpmyfaq/phpmyfaq |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-7gh7-qh7c-9r8mLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
