CVE-2026-49336: CWE-178: Improper Handling of Case Sensitivity in microsoft kiota-typescript
@microsoft/kiota-http-fetchlibrary provides TypeScript libraries for Kiota-generated API clients. In versions 1.0.0-preview.97 through 1.0.0-preview.101, `@microsoft/kiota-http-fetchlibrary`'s `RedirectHandler` is documented as stripping `Authorization` and `Cookie` from cross-origin redirect targets, but the default `scrubSensitiveHeaders` callback in `RedirectHandlerOptions` uses case-sensitive property deletion (`delete headers.Authorization`, `delete headers.Cookie`) on a headers object that `FetchRequestAdapter.getRequestFromRequestInformation` has already lower-cased. The delete therefore targets keys that do not exist, the scrub is a no-op, and any Bearer token or Cookie attached by a kiota-generated SDK is forwarded to an attacker-controlled host across a 30x redirect. This is reachable in the default middleware chain (`MiddlewareFactory.getDefaultMiddlewares`) with no custom configuration, and applies to every kiota-generated TypeScript SDK that uses `BaseBearerTokenAuthenticationProvider` or any other authentication provider that sets the `Authorization` request header. Version 1.0.0-preview.102 patches the issue.
AI Analysis
Technical Summary
@microsoft/kiota-http-fetchlibrary provides TypeScript libraries for Kiota-generated API clients. In versions 1.0.0-preview.97 through 1.0.0-preview.101, the RedirectHandler is intended to strip Authorization and Cookie headers from cross-origin redirect targets to prevent sensitive data leakage. However, the default scrubSensitiveHeaders callback uses case-sensitive deletion (e.g., delete headers.Authorization) on a headers object whose keys have already been lower-cased by FetchRequestAdapter.getRequestFromRequestInformation. As a result, the deletion attempts do not remove the intended headers, leaving Authorization and Cookie headers intact and forwarded to attacker-controlled hosts during 30x redirects. This vulnerability is present in the default middleware chain without custom configuration and affects any kiota-generated TypeScript SDK using BaseBearerTokenAuthenticationProvider or similar authentication providers. The issue is patched in version 1.0.0-preview.102.
Potential Impact
Sensitive authentication headers such as Authorization (Bearer tokens) and Cookie headers may be unintentionally forwarded to attacker-controlled hosts during cross-origin HTTP redirects. This can lead to unauthorized disclosure of authentication credentials, potentially allowing attackers to impersonate users or gain unauthorized access to protected resources. The vulnerability affects all kiota-generated TypeScript SDKs using the affected versions and default middleware configurations that set these headers.
Mitigation Recommendations
Upgrade to @microsoft/kiota-http-fetchlibrary version 1.0.0-preview.102 or later, where the issue is fixed. Until upgrading, be aware that the default middleware does not properly scrub sensitive headers on redirects, so consider implementing custom middleware to correctly handle header case sensitivity or avoid following cross-origin redirects that could leak sensitive headers.
CVE-2026-49336: CWE-178: Improper Handling of Case Sensitivity in microsoft kiota-typescript
Description
@microsoft/kiota-http-fetchlibrary provides TypeScript libraries for Kiota-generated API clients. In versions 1.0.0-preview.97 through 1.0.0-preview.101, `@microsoft/kiota-http-fetchlibrary`'s `RedirectHandler` is documented as stripping `Authorization` and `Cookie` from cross-origin redirect targets, but the default `scrubSensitiveHeaders` callback in `RedirectHandlerOptions` uses case-sensitive property deletion (`delete headers.Authorization`, `delete headers.Cookie`) on a headers object that `FetchRequestAdapter.getRequestFromRequestInformation` has already lower-cased. The delete therefore targets keys that do not exist, the scrub is a no-op, and any Bearer token or Cookie attached by a kiota-generated SDK is forwarded to an attacker-controlled host across a 30x redirect. This is reachable in the default middleware chain (`MiddlewareFactory.getDefaultMiddlewares`) with no custom configuration, and applies to every kiota-generated TypeScript SDK that uses `BaseBearerTokenAuthenticationProvider` or any other authentication provider that sets the `Authorization` request header. Version 1.0.0-preview.102 patches the issue.
CVSS v4.0
Score 5.5medium
Affected software
pkg:npm/@microsoft/kiota-http-fetchlibraryRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
@microsoft/kiota-http-fetchlibrary provides TypeScript libraries for Kiota-generated API clients. In versions 1.0.0-preview.97 through 1.0.0-preview.101, the RedirectHandler is intended to strip Authorization and Cookie headers from cross-origin redirect targets to prevent sensitive data leakage. However, the default scrubSensitiveHeaders callback uses case-sensitive deletion (e.g., delete headers.Authorization) on a headers object whose keys have already been lower-cased by FetchRequestAdapter.getRequestFromRequestInformation. As a result, the deletion attempts do not remove the intended headers, leaving Authorization and Cookie headers intact and forwarded to attacker-controlled hosts during 30x redirects. This vulnerability is present in the default middleware chain without custom configuration and affects any kiota-generated TypeScript SDK using BaseBearerTokenAuthenticationProvider or similar authentication providers. The issue is patched in version 1.0.0-preview.102.
Potential Impact
Sensitive authentication headers such as Authorization (Bearer tokens) and Cookie headers may be unintentionally forwarded to attacker-controlled hosts during cross-origin HTTP redirects. This can lead to unauthorized disclosure of authentication credentials, potentially allowing attackers to impersonate users or gain unauthorized access to protected resources. The vulnerability affects all kiota-generated TypeScript SDKs using the affected versions and default middleware configurations that set these headers.
Mitigation Recommendations
Upgrade to @microsoft/kiota-http-fetchlibrary version 1.0.0-preview.102 or later, where the issue is fixed. Until upgrading, be aware that the default middleware does not properly scrub sensitive headers on redirects, so consider implementing custom middleware to correctly handle header case sensitivity or avoid following cross-origin redirects that could leak sensitive headers.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-29T14:35:45.902Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a358c5cf198dc38c1f2fbba
Added to database: 6/19/2026, 6:37:16 PM
Last enriched: 6/19/2026, 6:51:24 PM
Last updated: 6/19/2026, 11:54:11 PM
Views: 8
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.