Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update node-fetch dependency #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mbeckem
Copy link

@mbeckem mbeckem commented Apr 4, 2022

Hello,

my team noticed that node-expose-sspi is currently (indirectly) affected by CVE-2022-0235. The reason for that is the pinned dependency on an older version of node-fetch ("3.0.0-beta.9").

My guess is that the old version of node-fetch is being used because it is the last version that can still be imported as a CommonJS module.
Later versions are published as ESM which is problematic for CommonJS clients.

This PR updates node-fetch and integrates it using the following approach:

  1. Use import type where only type declarations are required
  2. Using an ugly workaround to asynchronously import the fetch function (see loadNodeFetch.ts). Essentially, eval is used via new Function(...) to stop the TypeScript compiler from replacing an asynchronous import(...) expression.

Unfortunately I am unable to run all tests right now.
My main development setup is running Linux and my Windows VM is not part of an domain, making testing the server side code rather difficult.
I was able to test the client side SSO flow manually: it appears to work well.

@jlguenego
Copy link
Owner

jlguenego commented Apr 4, 2022 via email

@bdinesh
Copy link

bdinesh commented Jan 17, 2024

Hello,

When I use sso Client fetch method (in NodeJS 20.x), I'm seeing an error TypeError [ERR_INVALID_THIS]: Value of "this" must be of type URLSearchParams in node-fetch package. Looks like this issue is fixed in node-fetch v3.2 package. Is there any plan to update the dependencies of node-expose-sspi package to make it compatible with NodeJS v20?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants