{"id":"CVE-2026-58399","aliases":["CVE-2026-58399","GHSA-gfj5-979r-92pw"],"related":[],"kind":"vulnerability","state":"published","title":"@acastellon/auth has an authentication bypass via spoofable headers in validateToken()","summary":"@acastellon/auth is an authentication control system for microservices. Versions prior to 2.3.0 appear to allow an unauthenticated authentication bypass in validateToken() through spoofable auth-user and Host request headers. The validateToken middleware contains a service-to-service bypass for auth-user: service-brother when req.get('host').startsWith(getHostName()). Both values involved in the check can be influenced by an unauthenticated HTTP client: auth-user is a request header, and Host is also client-controlled. As a result, a remote unauthenticated attacker can send a request with crafted headers and bypass token validation before the normal legacy/JWT/OIDC validation logic runs. A fix has been implemented in v2.3.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"@acastellon/auth is an authentication control system for microservices. Versions prior to 2.3.0 appear to allow an unauthenticated authentication bypass in validateToken() through spoofable auth-user and Host request headers. The validateToken middleware contains a service-to-service bypass for auth-user: service-brother when req.get('host').startsWith(getHostName()). Both values involved in the check can be influenced by an unauthenticated HTTP client: auth-user is a request header, and Host is also client-controlled. As a result, a remote unauthenticated attacker can send a request with crafted headers and bypass token validation before the normal legacy/JWT/OIDC validation logic runs. A fix has been implemented in v2.3.0.","source":"cvelist"},{"lang":"en","text":"@acastellon/auth v2.2.0 appears to allow an unauthenticated authentication bypass in validateToken() through spoofable auth-user and Host request headers.\n\nThe validateToken middleware contains a service-to-service bypass for auth-user: service-brother when req.get('host').startsWith(getHostName()). Both values involved in the check can be influenced by an unauthenticated HTTP client: auth-user is a request header, and Host is also client-controlled. As a result, a remote unauthenticated attacker can send a request with crafted headers and bypass token validation before the normal legacy/JWT/OIDC validation logic runs.\n\nImpact:\nAn attacker may be able to access routes protected by validateToken() without a valid token. In deployments where downstream services trust auth-user or is-* headers, this may also lead to privilege escalation.\n\nAffected package:\n@acastellon/auth v2.2.0\n\nAffected code:\nauth.js, validateToken()\nThe issue is related to the service-brother bypass and getHostName() check.\n\nExample request:\n```\nGET /protected HTTP/1.1\nHost: <configured CNAME or hostname>\nauth-user: service-brother\nis-admin: true\n```\n\nExpected behavior:\nThe request should require a valid authentication token.\n\nActual behavior:\nThe middleware calls next() before token validation.\n\nFix implemented in v2.3.0+:\n\nRemoved the spoofable bypass.\nAlways sanitize incoming auth-user and is-* headers.\nAdded mTLS client certificate based service auth (with optional TRUSTED_MTLS_SERVICES allowlist).\nUpdated consumers (rest, graphql, dns-client) for mTLS support.\nUnit tests added for sanitization + mTLS path.","format":"markdown","source":"ghsa"},{"lang":"es","text":"@acastellon/auth es un sistema de control de autenticación para microservicios. Las versiones anteriores a la 2.3.0 parecen permitir una omisión de autenticación no autenticada en validateToken() a través de encabezados de solicitud auth-user y Host falsificables. El middleware validateToken contiene una omisión de servicio a servicio para auth-user: service-brother cuando req.get(’host’).startsWith(getHostName()). Ambos valores involucrados en la verificación pueden ser influenciados por un cliente HTTP no autenticado: auth-user es un encabezado de solicitud, y Host también es controlado por el cliente. Como resultado, un atacante remoto no autenticado puede enviar una solicitud con encabezados manipulados y omitir la validación del token antes de que se ejecute la lógica de validación normal de legacy/JWT/OIDC. Se ha implementado una solución en la v2.3.0.","source":"nvd"}],"published":"2026-06-18T17:22:47.000Z","modified":"2026-10-25T17:10:00.197Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N","rating":"CRITICAL"}],"cwes":["CWE-287","CWE-290"],"affected":[{"ranges":[{"version":"< 2.3.0","status":"affected"}],"vendor":"antonio-castellon","product":"module-auth","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.3.0"}],"ecosystem":"npm","package":"@acastellon/auth","purl":"pkg:npm/%40acastellon/auth","source":"ghsa"}],"references":[{"url":"https://github.com/antonio-castellon/module-auth/security/advisories/GHSA-gfj5-979r-92pw","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/antonio-castellon/module-auth/issues/6","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.npmjs.com/package/@acastellon/auth/v/2.3.0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/antonio-castellon/module-auth","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-07-02T14:25:47.187Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-58399","url":"https://www.cve.org/CVERecord?id=CVE-2026-58399","licence":"CVE Terms of Use","modified":"2026-07-02T14:26:00.684Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-gfj5-979r-92pw","url":"https://github.com/advisories/GHSA-gfj5-979r-92pw","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:08.661Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-58399","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-58399","licence":"Public domain","modified":"2026-10-25T17:10:00.197Z"}],"updatedAt":"2026-11-25T22:59:26.909Z","epss":{"score":0.00543,"percentile":0.47016,"date":"2026-12-01T12:00:22.000Z"}}