llamaCVEVulnerability Intelligence
/
Advisory · GitHub · PyPI · modoboa

GHSA-P68V-69QC-9345

DKIM selector injection in rspamd selector map via relay domain API

Texto original en inglés · Ver en español

Parche disponible
Descargar PNG JSON
CVSS 3.1
2.7
Baja
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:L/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición8 dDesde la divulgación, 13 nov 2026, 11:25 a. m.
Detección5 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Hasta mi siesta tiene más impacto.Riesgo bajo: puedes terminar tu café.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 2.13.0
Monitoreo
Detectada +1
13 nov 26
19 nov 26
21 nov 26
13 nov 26
15 nov 26
17 nov 26
19 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-P68V-69QC-9345 divulgada · CVSS 2.7 (GitHub)
Remediación Parche 2.13.0 modoboa · 0 d desde divulgación
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Summary

The relay domain API endpoint accepts an unvalidated `dkim_key_selector`,
which is written verbatim into the rspamd DKIM selector map. A user with
the Reseller role can embed a carriage return in the selector to inject a
map entry overriding the DKIM selector of a domain owned by another
tenant, breaking DKIM signing for that domain. This is an incomplete fix
of the selector validation introduced in 2.9.1, which only covered the
regular domain API.

Details

`DomainSerializer` (`modoboa/admin/api/v1/serializers.py`, also used by
API v2) restricts `dkim_key_selector` to `[A-Za-z0-9._-]+` since 2.9.1.
`RelayDomainSerializer` (`modoboa/relaydomains/api/v1/serializers.py`)
exposes the same model field as writable but has no such validator, and
the `Domain.dkim_key_selector` model field itself carries no validation
(only `max_length=30`).

When a domain with DKIM enabled is saved, `rspamd.jobs.update_rspamd_maps`
rewrites the selector map with one `<domain> <selector>` line per domain.
The selector is only sanitized with `.replace("\n", "")`, so a `\r` is
written to the file unchanged.

On the next map update, `MapsUpdater.load_map` reads the file in Python
text mode (universal newlines), where `\r` is a line terminator. The line

attacker.test a\rvictim.com evilsel

is therefore parsed as two entries, `attacker.test -> a` and
`victim.com -> evilsel`. The injected entry overrides the legitimate one
for `victim.com` and is persisted on the next write. It stays in place
until `victim.com` itself is modified, which rewrites its entry.

The DKIM private key map is not affected (`dkim_private_key_path` is
read-only in the API), so rspamd signs mail for `victim.com` with the
correct key but a wrong selector, and DKIM verification fails.

A selector containing a space (`"a b"`) produces a line with three fields;
it is discarded as malformed and only breaks the attacker's own entry.

Requirements: rspamd integration enabled with DKIM selector and key maps
configured, and an account allowed to create or change domains (Reseller
or SuperAdmin).

Proof of concept
  1. Log in as a Reseller and obtain an API token.
  2. Create a relay domain with DKIM enabled and a crafted selector

curl -s -X POST https://modoboa.example/api/v1/relaydomains/ \
-H "Authorization: Token <reseller-token>" \
-H "Content-Type: application/json" \
-d '{
"name": "attacker.test",
"enabled": true,
"enable_dkim": true,
"dkim_key_selector": "a\rvictim.com evilsel",
"transport": {"service": "relay",
"_settings": "{\"relay_target_host\": \"127.0.0.1\", \"relay_target_port\": 25}"}
}'

The API returns `201 Created`. The same payload sent to
`/api/v1/domains/` is rejected with "Enter a valid DKIM selector".
3. Once a DKIM key has been generated for the domain
(`python manage.py modo manage_dkim_keys`), the selector map contains:

attacker.test a\rvictim.com evilsel

  1. Trigger any later map update (for instance by saving any domain with

victim.com evilsel

Outgoing mail for `victim.com` is signed with selector `evilsel`, for
which no DNS record exists, and fails DKIM verification.

The parsing behaviour can be checked on its own:

import tempfile
p = tempfile.mktemp()
open(p, "w").write("attacker.test a\rvictim.com evilsel\n")
print([line.split() for line in open(p)])
# [['attacker.test', 'a'], ['victim.com', 'evilsel']]

Impact

The relay domain API (`/api/v1/relaydomains/`) accepted an arbitrary
`dkim_key_selector` value. This value is written verbatim into the rspamd
DKIM selector map. The selector validation added in 2.9.1 to block this
injection class was only applied to the regular domain API, and the map
writer only stripped `\n` characters.

A user allowed to create or change domains (Reseller role) could set a
selector containing a carriage return to inject an entry for a domain
belonging to another tenant into the selector map. That domain's outgoing
mail would then be signed with a wrong selector, making DKIM verification
(and potentially DMARC) fail. The private key map is not affected: an
attacker cannot sign mail on behalf of another domain.

Only installations using the rspamd integration with DKIM enabled are
affected.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:H
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:N
AltoBajoNinguno
IntegridadI:L
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
5.0/ 10Medio
Vector 5.0 (moderada) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida Última
modoboa≤ 2.12.0
2.12.0
2.13.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
pypimodoboa
Corregida 2.13.0 0 d 2.13.0 no afectada
Versiones corregidas2.13.0
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/modoboa/modoboa/security/advisories/GHSA-p68v-69qc-9345

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.