{"id":"CVE-2026-41070","aliases":["CVE-2026-41070","GHSA-246w-jgmq-88fg","GO-2026-4963"],"related":[],"kind":"vulnerability","state":"published","title":"openvpn-auth-oauth2 returns FUNC_SUCCESS on client-deny, allowing unauthenticated VPN access","summary":"openvpn-auth-oauth2 is a plugin/management interface client for OpenVPN server to handle an OIDC based single sign-on (SSO) auth flows. From version 1.26.3 to before version 1.27.3, when openvpn-auth-oauth2 is deployed in the experimental plugin mode (shared library loaded by OpenVPN via the plugin directive), clients that do not support WebAuth/SSO (e.g., the openvpn CLI on Linux) are incorrectly admitted to the VPN despite being denied by the authentication logic. The default management-interface mode is not affected because it does not use the OpenVPN plugin return-code mechanism. This issue has been patched in version 1.27.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"openvpn-auth-oauth2 is a plugin/management interface client for OpenVPN server to handle an OIDC based single sign-on (SSO) auth flows. From version 1.26.3 to before version 1.27.3, when openvpn-auth-oauth2 is deployed in the experimental plugin mode (shared library loaded by OpenVPN via the plugin directive), clients that do not support WebAuth/SSO (e.g., the openvpn CLI on Linux) are incorrectly admitted to the VPN despite being denied by the authentication logic. The default management-interface mode is not affected because it does not use the OpenVPN plugin return-code mechanism. This issue has been patched in version 1.27.3.","source":"cvelist"},{"lang":"en","text":"# Summary\n\nWhen `openvpn-auth-oauth2` is deployed in the **experimental plugin mode** (shared library loaded by OpenVPN via the `plugin` directive), clients that do not support WebAuth/SSO (e.g., the `openvpn` CLI on Linux) are incorrectly admitted to the VPN despite being denied by the authentication logic. **The default management-interface mode is not affected** because it does not use the OpenVPN plugin return-code mechanism.\n\n# Impact\n\n**Authentication bypass — any VPN client that does not advertise WebAuth/SSO support (`IV_SSO=webauth`) is granted full network access without completing OIDC authentication.**\n\nThis affects only deployments running the **experimental plugin mode** in versions 1.26.3 through 1.27.2. The default and recommended deployment via the management interface is **not affected**.\n\nAn unauthenticated attacker can connect to the OpenVPN server using any standard OpenVPN client that does not support webauth (e.g., the Linux `openvpn` CLI). The plugin correctly issues a `client-deny` command via the management interface, but returns `OPENVPN_PLUGIN_FUNC_SUCCESS` (status=0) to OpenVPN. Because the `auth_control_file` content is only consulted when the plugin returns `FUNC_DEFERRED`, OpenVPN interprets status=0 as \"authentication passed\" and admits the client — granting full access to the internal network behind the VPN.\n\n\n## Root Cause\n\nIn `lib/openvpn-auth-oauth2/openvpn/handle.go`, the `ClientAuthDeny` branch of `handleAuthUserPassVerify` wrote `\"0\"` (deny) to the `auth_control_file` but returned `OPENVPN_PLUGIN_FUNC_SUCCESS`. OpenVPN only reads the `auth_control_file` when the plugin returns `FUNC_DEFERRED`; a synchronous `FUNC_SUCCESS` return is treated as immediate approval regardless of file contents.\n\n**Before fix:**\n```go\ncase management.ClientAuthDeny:\n    // ... writes \"0\" to auth_control_file ...\n    if err := openVPNClient.WriteToAuthFile(\"0\"); err != nil {\n        // only returned ERROR on write failure\n        return c.OpenVPNPluginFuncError\n    }\n    return c.OpenVPNPluginFuncSuccess  // ← BUG: OpenVPN sees this as \"auth passed\"\n```\n\n**After fix (commit [`36f69a6`](https://github.com/jkroepke/openvpn-auth-oauth2/commit/36f69a6c67c1054da7cbfa04ced3f0555127c8f2)):**\n```go\ncase management.ClientAuthDeny:\n    // ... writes \"0\" to auth_control_file ...\n    if err := openVPNClient.WriteToAuthFile(\"0\"); err != nil {\n        logger.ErrorContext(p.ctx, \"write to auth file\", slog.Any(\"err\", err))\n    }\n    return c.OpenVPNPluginFuncError  // ← FIX: OpenVPN now correctly rejects the client\n```\n\n# Patches\n\nThis vulnerability is fixed in **v1.27.3**. Users of the experimental plugin mode should upgrade immediately.\n\n- **Fix commit:** [`36f69a6`](https://github.com/jkroepke/openvpn-auth-oauth2/commit/36f69a6c67c1054da7cbfa04ced3f0555127c8f2)\n- **Fix PR:** [#829](https://github.com/jkroepke/openvpn-auth-oauth2/pull/829)\n\n# Workarounds\n\n- **Switch to standalone management client mode** (the default, non-plugin deployment). This mode is not affected by the vulnerability because authentication decisions are communicated entirely through the management interface protocol, not through the plugin return code.\n- **Restrict VPN access at the network level** to only clients known to support WebAuth/SSO (e.g., OpenVPN Connect 3+), although this is difficult to enforce reliably and is not recommended as a sole mitigation.","format":"markdown","source":"ghsa"},{"lang":"en","text":"openvpn-auth-oauth2 returns FUNC_SUCCESS on client-deny, allowing unauthenticated VPN access in github.com/jkroepke/openvpn-auth-oauth2","format":"markdown","source":"go"},{"lang":"es","text":"openvpn-auth-oauth2 es un plugin/cliente de interfaz de gestión para el servidor OpenVPN para manejar flujos de autenticación de inicio de sesión único (SSO) basados en OIDC. Desde la versión 1.26.3 hasta antes de la versión 1.27.3, cuando openvpn-auth-oauth2 se despliega en el modo de plugin experimental (biblioteca compartida cargada por OpenVPN a través de la directiva plugin), los clientes que no soportan WebAuth/SSO (por ejemplo, la CLI de openvpn en Linux) son admitidos incorrectamente a la VPN a pesar de ser denegados por la lógica de autenticación. El modo de interfaz de gestión predeterminado no se ve afectado porque no utiliza el mecanismo de código de retorno del plugin de OpenVPN. Este problema ha sido parcheado en la versión 1.27.3.","source":"nvd"}],"published":"2026-04-22T14:28:11.000Z","modified":"2026-10-26T18:10:00.173Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N","score":10,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N","score":10,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N","score":10,"rating":"CRITICAL"}],"cwes":["CWE-287"],"affected":[{"ranges":[{"version":">= 1.26.3, < 1.27.3","status":"affected"}],"vendor":"jkroepke","product":"openvpn-auth-oauth2","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"1.26.3","status":"affected","fixed":"1.27.3"}],"ecosystem":"Go","package":"github.com/jkroepke/openvpn-auth-oauth2","purl":"pkg:golang/github.com/jkroepke/openvpn-auth-oauth2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.26.3","status":"affected","fixed":"1.27.3"}],"ecosystem":"Go","package":"github.com/jkroepke/openvpn-auth-oauth2","purl":"pkg:golang/github.com/jkroepke/openvpn-auth-oauth2","source":"go"}],"references":[{"url":"https://github.com/jkroepke/openvpn-auth-oauth2/security/advisories/GHSA-246w-jgmq-88fg","tags":["advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/jkroepke/openvpn-auth-oauth2/commit/36f69a6c67c1054da7cbfa04ced3f0555127c8f2","tags":["fix","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41070","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/jkroepke/openvpn-auth-oauth2/pull/829","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/OpenVPN/openvpn/blob/master/include/openvpn-plugin.h.in","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/OpenVPN/openvpn3/blob/master/doc/webauth.md","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/jkroepke/openvpn-auth-oauth2","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/jkroepke/openvpn-auth-oauth2/releases/tag/v1.27.3","tags":["web"],"sources":["ghsa","go"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-05-08T16:05:27.096Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41070","url":"https://www.cve.org/CVERecord?id=CVE-2026-41070","licence":"CVE Terms of Use","modified":"2026-05-08T16:05:34.531Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-246w-jgmq-88fg","url":"https://github.com/advisories/GHSA-246w-jgmq-88fg","licence":"CC-BY-4.0","modified":"2026-05-20T19:41:27.183Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4963","url":"https://pkg.go.dev/vuln/GO-2026-4963","licence":"CC-BY-4.0","modified":"2026-05-20T19:30:11.543Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41070","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41070","licence":"Public domain","modified":"2026-10-26T18:10:00.173Z"}],"updatedAt":"2026-11-25T22:59:21.093Z","epss":{"score":0.00438,"percentile":0.39807,"date":"2026-12-01T12:00:22.000Z"}}