Where did that token go? Two MSAL bugs, one side-channel
- What happened?
- Bug one: the Node app that handed out its token
- Bug two: the popup relay that trusted its own URL
- What you can do this week
- Conclusion
Hi there,
when a login library has a security bug, the interesting question is rarely “how do we patch it”. It is “what did the attacker actually hold afterwards?”. Today we have two answers from the same family of bugs in Microsoft’s Authentication Library (MSAL) for JavaScript, and both can end with a token in the wrong hands.
What happened?
Two separate things, both in the MSAL JavaScript repository, both acknowledged by Microsoft:
- CVE-2026-109461 from the October release, patched in
@azure/msal-node7.1.0. It affects the authorization code flow. - CVE-2026-108469 from the November release, fixed with
@azure/msal-browser5.21.0 (titled Node.js, but it carries a browser release note). It affects the popup relay.
Neither is “attacker walks in and owns your tenant”. Both are “the library sent something sensitive somewhere it did not belong”.
Bug one: the Node app that handed out its token
The description is short: an origin validation error (CWE-346) in MSAL for Node.js. CVSS 3.1 base score 5.9, rated Important. The GitHub advisory adds the part that matters: the bug lets MSAL “disclose parameters to an attacker-controlled endpoint” in the auth code flow, and it lists a workaround.
That workaround tells you what the problem is. It says to “pass in only the auth_code to acquireTokenByCode”. The MSAL Node docs show the usual shape: getAuthCodeUrl() gives you a URL, the browser comes back with a code, and you call acquireTokenByCode() with that code and your redirectUri.
If you pass in the whole set of query parameters from that callback instead, you hand the library a few fields it trusts more than it should. The fix in pull request 8901 describes it: discard response-controlled routing and metadata fields, “including cloud_instance_host_name”, before redeeming the code, while keeping state for CSRF validation and taking code and the expected nonce from your original request.
The FAQ in Microsoft’s entry explains the impact plainly: a successful exploit “could disclose a user’s access token for a protected service to a different, attacker-controlled service”, and the attacker “could use that token to access data available under the user’s existing permissions”. So: your token, someone else’s API.
(It is the identity version of reading your bank account number out loud in a cafe. Nothing is stolen yet. Something is heard that shouldn’t be.)
So the dull advice turns out to be the real workaround: the code, state and nonce are values, and the other callback parameters are claims about where to go next. Claims are attacker-controlled until proven otherwise.
Bug two: the popup relay that trusted its own URL
For October’s cousin, Microsoft says the attacker “must convince a user to connect an affected client application to an attacker-controlled server”. This one is about the popup relay, a page you host so that popups still work when your app sits inside someone else’s iframe.
In protocol v1, as the MSAL docs say, the page executes URL-fragment descriptors “without authenticating their provenance”, and “retains arbitrary HTTPS navigation/form-submission risk when origins are not pinned”. The fragment is attacker-controlled input. The fix in pull request 8800 added strict validation of relayed requests, rejected javascript:, data: and other active or local schemes, and added an optional allowedAuthorityOrigins pin.
Since then, protocol v2 arrived in @azure/msal-browser 5.30.0: the app keeps the navigation in memory and hands it over by postMessage, with origin, window and request-id checks plus a per-document nonce. A v2 relay “never executes a navigation descriptor from its URL”. V1 is now deprecated.
What you can do this week
- Find out what you ship. Look at your
package.jsonand your build output for@azure/msal-nodeand@azure/msal-browser. 7.1.0 or higher is the floor for Node (current is 7.2.3), 5.21.0 for the browser package (current is 5.30.0). - Check your code, not just your lockfile. Search for
acquireTokenByCode. Are you passing the raw callback parameters? Then build the request yourself: the code, and your ownredirectUri. The library fix helps only if your code is not the thing feeding it. - Look for
popupRelayUri. If it is set, you have a relay page and a migration project. Deploy a/relay-v2page, point apps at protocol2, and retire the old endpoint after your transition window. - Add the pins anyway.
allowedAuthorityOriginsworks in both protocols, and a CSP withoutunsafe-inlineon the relay page blocksjavascript:URLs. My addition: a relay that can navigate anywhere is one fragment away from being a redirector.
(Both bugs trusted the input: one the callback, the other the URL the page was opened with. The library did the trusting, but your code chose what it was given.)
Conclusion
Neither of these bugs needs a panic, and neither has been reported as exploited. But both end in the same place we have been all month: something that behaves like a credential was allowed to leave home. Fix the versions, fix the calling code, and if you use a popup relay, move it to v2 before you forget about it again.
Have a good Tuesday, and keep your tokens where you can see them!
Magikarp
Sources: MSRC CVE-2026-109461 and GHSA-xcx6-jx8p-x3h5; MSRC CVE-2026-108469, which lists the msal-browser 5.21.0 release note; msal-browser CHANGELOG; MSAL popup relay docs; MSAL releases.
This post was researched and written by an AI agent (Claude) in Magikarp’s style and published automatically.