mollie-api-node icon indicating copy to clipboard operation
mollie-api-node copied to clipboard

Axios Dependancy

Open marxys opened this issue 1 year ago • 3 comments

Hello I saw that mollie-api-node run with an old version of Axios. Here is my npm audit logs :

Axios Cross-Site Request Forgery Vulnerability - https://github.com/advisories/GHSA-wf5p-g6vw-rhxx
No fix available
node_modules/@mollie/api-client/node_modules/axios
  @mollie/api-client  <=3.7.0
  Depends on vulnerable versions of axios
  node_modules/@mollie/api-client

I solve the issue on my side installing this : npm install npm-force-resolutions --save-dev

Then add this on the package.json :

"resolutions": {
  "axios": "1.6.8"
}
"scripts": {
  // add to existing scripts
  "preinstall": "npx npm-force-resolutions"
}

Then npm run preinstall to upgrade.

marxys avatar May 06 '24 10:05 marxys

@maria-swierblewska @Pimm any timeline on solving this?

vdhpieter avatar Jun 21 '24 10:06 vdhpieter

Yeah, would like to see this updated as well.

As per advisory https://github.com/advisories/GHSA-wf5p-g6vw-rhxx, the minimum patched version would be 0.28.0

To patch this in your own repo for now (when using pnpm), add this to your package.json, and run pnpm i

  "pnpm": {
    "overrides": {
      "axios": "^0.28.0"
    }
  }

n2k3 avatar Jul 03 '24 20:07 n2k3

Thanks for opening this issue.

The vulnerability in question can potentially reveal a secret stored in a cookie to untrusted servers. This client is not designed to run in a browser, so cookies are not a concern. Furthermore, the client connects to the Mollie server exclusively. The vulnerability therefore does not affect this client or its users, which is why no emergency release was made in response to it.

With that said, we plan to release a new version no later than next week.

If that is not soon enough, install the beta version:

npm install @mollie/api-client@beta

Pimm avatar Jul 05 '24 09:07 Pimm

Any news on this yet?

dannybunschoten avatar Jul 25 '24 14:07 dannybunschoten

We are working on a version of the client which uses fetch internally, swapping out Axios altogether. It hasn't been thoroughly tested, but it seems we will go with this approach in 4.0.0.

Until then ‒ provided that you're on Node.js 14+ ‒ you can use the beta version:

npm install @mollie/api-client@beta

Pimm avatar Jul 26 '24 08:07 Pimm

The current version on master uses fetch instead of Axios. Version 4.0.0 will include this change.

Pimm avatar Sep 10 '24 13:09 Pimm