Media

CKAN MCP Server: MQA server allowlist bypass via unanchored regex (`isValidMqaServer`)

  • Publicada: 02.09.2026
  • Actualizado: 11.10.2026 10:22

Summary

The ckan_get_mqa_quality and ckan_get_mqa_quality_details tools restrict their server_url argument to dati.gov.it via a regular expression. The regex is anchored only at the start and places no boundary after the host, so any URL whose host merely begins with dati.gov.it — or that uses dati.gov.it as URL userinfo before an @ — passes validation while actually targeting an attacker-controlled host.

Affected code

js
// src/tools/quality.ts
const ALLOWED_SERVER_PATTERNS = [
  /^https?:\/\/(www\.)?dati\.gov\.it/i        // <-- no end anchor / host boundary
];
export function isValidMqaServer(serverUrl: string): boolean {
  return ALLOWED_SERVER_PATTERNS.some(pattern => pattern.test(serverUrl));
}

All of the following return true:

URL Real host
https://dati.gov.it.attacker.com/x dati.gov.it.attacker.com (attacker)
http://dati.gov.it.evil.example/api dati.gov.it.evil.example (attacker)
https://dati.gov.it@attacker.com/x attacker.com (userinfo trick)

After passing this check, server_url flows into getMqaQuality/getMqaQualityDetails, which call makeCkanRequest(serverUrl, "package_show", { id }). The server therefore issues a request to the attacker-controlled host and returns its (parsed) response to the caller.

Impact

  • The intended "dati.gov.it only" trust boundary for the MQA tools is defeated; they can be driven against arbitrary external hosts.
  • The attacker host receives the request (including the dataset_id) and controls the response body that is surfaced back to the model/user — enabling response spoofing and, in an agentic setting, indirect prompt-injection content delivered under the guise of a trusted-portal tool.
  • Contributes to SSRF surface: while makeCkanRequest blocks private/internal IPs, this bypass removes the domain restriction that the code intends to enforce for these tools.

The @-userinfo variant is the most severe form because validation passes on a string whose actual host is fully attacker-chosen.

Proof of concept

poc/mqa-allowlist-poc.mjs runs the verbatim regex over benign and malicious URLs:

accepted  expected_legit  url
true      true            https://dati.gov.it/opendata          <- legit
true      false           https://dati.gov.it.attacker.com/x    <- BYPASS
true      false           http://dati.gov.it.evil.example/api   <- BYPASS
true      false           https://dati.gov.it@attacker.com/x    <- BYPASS

Remediation

Validate the parsed host, not the raw string. For example:

js
function isValidMqaServer(serverUrl) {
  let u; try { u = new URL(serverUrl); } catch { return false; }
  if (u.protocol !== "https:") return false;
  const h = u.hostname.toLowerCase();
  return h === "dati.gov.it" || h === "www.dati.gov.it";
  // or: h === "dati.gov.it" || h.endsWith(".dati.gov.it")
}

Anchoring the regex end-to-end (/^https:\/\/(www\.)?dati\.gov\.it(\/|$)/i) also closes the suffix trick, but URL-parsing + exact host comparison is the robust fix and also neutralizes the @-userinfo variant.

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Paquete de npm @aborruso/ckan-mcp-server < 0.4.112 0.4.112

Referencias

Puntuación CVSS 5.3/10
Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Debilidad (CWE)
CWE-20, CWE-625, CWE-918
Plataforma
npm
Paquete
@aborruso/ckan-mcp-server
Publicada
02.09.2026
Actualizado
11.10.2026 10:22

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-83x6-42hr-jc76 - CC BY 4.0

Historial de vulnerabilidades: @aborruso/ckan-mcp-server

Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Entradas en total
7
Primera → última
03.2026 10.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Media 5
  • Baja 2

Divulgaciones por año

  1. 2026: 7
  1. Baja · 3.7 CVE-2026-73844 < 0.4.112 0.4.112
  2. CKAN MCP Server: MQA server allowlist bypass via unanchored regex (`isValidMqaServer`) esta entrada
    Media · 5.3 CVE-2026-73845 < 0.4.112 0.4.112

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.