ThinkFacility Sign in
  1. Home
  2. Security
  3. npm package (@azure/msal-node)
Mediumnpm package (@azure/msal-node)

MSAL Node 5 to before 7.1.0: Microsoft sign-in code flow can leak details to an attacker

Developers whose Node.js apps sign people in with Microsoft accounts through @azure/msal-node and the authorization code flow.

How to fix it

You haveUpdate to
5.0.0-beta.0 and later, before 7.1.0→7.1.0

Check your version

Which version your project has
npm ls @azure/msal-node

Update

In your project
npm update @azure/msal-node
npm ls @azure/msal-node
Still old? A dependency pins it
npm explain @azure/msal-node
Then check what's left
npm audit

If you can't update yet

Pass only the auth_code to acquireTokenByCode until you can update.

Microsoft calls it an origin validation error in the auth_code flow that lets an attacker who isn't signed in get information over the network. Microsoft rates it Medium, at 5.9; GitHub's advisory rates it High, at 7.5.

If npm ls still shows an old version under another package, update that package, or add an "overrides" entry for this one in package.json.

Sources