vercel icon indicating copy to clipboard operation
vercel copied to clipboard

Latest version of cli is pulling in insecure packages that have available patches

Open G-Rath opened this issue 1 year ago • 20 comments

The latest version of the vercel cli is pulling in packages with known vulnerabilities that have available patches.

Current vulnerabilities:

  • [ ] path-to-regexp v6.1.0, via @vercel/routing-utils and @vercel/remix-builder
    • (https://github.com/vercel/vercel/pull/12131, https://github.com/vercel/vercel/pull/12734 -> reverted: https://github.com/vercel/vercel/pull/12746)
    • GHSA-9wv6-86v2-598j
  • [x] tar v4.4.18, via @vercel/fun (patched in v1.1.5, just waiting for https://github.com/vercel/vercel/pull/13070 to land)
    • GHSA-f5x3-32g6-xq36
  • [ ] undici v5.28.4, via @vercel/node (waiting on https://github.com/vercel/vercel/pull/13380 to be landed and released)
    • GHSA-c76h-2ccp-4975
    • GHSA-cxrh-j4jr-qwg3
  • [ ] esbuild v0.14.47, via @vercel/node and @vercel/gatsby-plugin-vercel-builder
    • GHSA-67mh-4wv8-2f99

While I don't believe any of these are exploitable in the context of this cli, they are a nuisance since non-breaking patches are available and security policies can make these expensive to ignore.

`npm audit` output as of 2025-06-10
# npm audit report

esbuild  <=0.24.2
Severity: moderate
esbuild enables any website to send any requests to the development server and read the response - https://github.com/advisories/GHSA-67mh-4wv8-2f99
fix available via `npm audit fix --force`
Will install [email protected], which is a breaking change
node_modules/esbuild
  @vercel/gatsby-plugin-vercel-builder  *
  Depends on vulnerable versions of esbuild
  node_modules/@vercel/gatsby-plugin-vercel-builder
    @vercel/static-build  >=1.3.0
    Depends on vulnerable versions of @vercel/gatsby-plugin-vercel-builder
    node_modules/@vercel/static-build
      vercel  >=25.2.1
      Depends on vulnerable versions of @vercel/node
      Depends on vulnerable versions of @vercel/remix-builder
      Depends on vulnerable versions of @vercel/static-build
      node_modules/vercel
  @vercel/node  >=2.3.1
  Depends on vulnerable versions of esbuild
  Depends on vulnerable versions of path-to-regexp
  Depends on vulnerable versions of undici
  node_modules/@vercel/node

path-to-regexp  4.0.0 - 6.2.2
Severity: high
path-to-regexp outputs backtracking regular expressions - https://github.com/advisories/GHSA-9wv6-86v2-598j
fix available via `npm audit fix --force`
Will install [email protected], which is a breaking change
node_modules/path-to-regexp
  @vercel/remix-builder  <=2.0.3 || >=5.2.4
  Depends on vulnerable versions of path-to-regexp
  node_modules/@vercel/remix-builder

undici  <=5.28.5
Severity: moderate
Use of Insufficiently Random Values in undici - https://github.com/advisories/GHSA-c76h-2ccp-4975
undici Denial of Service attack via bad certificate data - https://github.com/advisories/GHSA-cxrh-j4jr-qwg3
fix available via `npm audit fix --force`
Will install [email protected], which is a breaking change
node_modules/undici

8 vulnerabilities (4 moderate, 4 high)

To address all issues (including breaking changes), run:
  npm audit fix --force

Related issues and pull requests:

  • https://github.com/vercel/vercel/issues/11201
  • https://github.com/vercel/fun/issues/104
  • https://github.com/vercel/fun/pull/98
  • https://github.com/vercel/fun/pull/95
  • https://github.com/vercel/fun/pull/96

G-Rath avatar May 04 '24 21:05 G-Rath

Thanks for staying on top of this @G-Rath

soulofmischief avatar Jun 10 '24 06:06 soulofmischief

Thanks, but unfortunately I'm not confident that they'll get addressed anytime soon - we're currently in the process of reviewing moving our Vercel apps to Netlify since they setup a whole internal workflow to stay on top of these updates in response to my equivalent issue about their cli (which is even more impressive given they use a shrink-wrap.json where Vercel just pins their top level dependences).

I will continue to update this issue for the foreseeable future though

G-Rath avatar Jun 10 '24 06:06 G-Rath

This is very important for organizations that have security policies that require packages to be updated with all security patches.

justinoboyle avatar Jun 12 '24 14:06 justinoboyle

Added new https://github.com/advisories/GHSA-9wv6-86v2-598j vulnerability, and marked micromatch as patched

G-Rath avatar Sep 12 '24 00:09 G-Rath

I realise that these are probably low priority for the team as these are probably not issues for the CLI, but it would help teams like ours if these were cleaned up. Dependabot raises these as security issues, and we need to dig in and assess if they really are issues or not.

CC @trek to perhaps raise with the team.

mrmckeb avatar Oct 10 '24 23:10 mrmckeb

Hello,

I've got all of these vulnerabilities showing up in GitHub - including undici, btw - though I'm mainly concerned about path-to-regexp and semver as they are both rated as high risk.

Now I appreciate that the vulnerabilities may not be exploitable and therefore the risk level is arguably wrong, but even so, we've still got to convince our external auditors of this, which is going to take time and if we fail to do so then that's our security certification up in smoke. I'm sure many other vercel users will have similar problems.

So I would like to respectfully request an update, and reiterate that whilst this may be low priority for some people it is not low priority for everyone. Far from it.

chrisdenton-ct avatar Nov 12 '24 14:11 chrisdenton-ct

+1 @chrisdenton-ct

It's important for us too

gaelperon avatar Nov 12 '24 16:11 gaelperon

@chrisdenton-ct - I emailed vercel security directly about this a few months ago.

Essentially they said they're always keeping track of potential security threats and they're aware of these reports but they don't consider them issues and they're not going to fix it

omonk avatar Nov 12 '24 18:11 omonk

Apparently it's not an issue for Vercel if companies can't use Vercel because the nested dependencies are flagged. Strange business decision

burtek avatar Nov 12 '24 18:11 burtek

@chrisdenton-ct - I emailed vercel security directly about this a few months ago.

Essentially they said they're always keeping track of potential security threats and they're aware of these reports but they don't consider them issues and they're not going to fix it

Thanks, that's useful to know, though obviously I find that response from vercel to be disappointing.

chrisdenton-ct avatar Nov 12 '24 19:11 chrisdenton-ct

I'll try and dig out the email tomorrow

omonk avatar Nov 12 '24 19:11 omonk

I have sent an email to the Vercel security team

gaelperon avatar Nov 13 '24 08:11 gaelperon

I emailed the security team requesting they fix the issues listed in this specific issue

Their reply on 23 Sept 2024:


Thank you for contacting the Vercel security team. Our software is patched in alignment with our internal vulnerability management process timelines, which relies heavily on contextualisation of vulnerabilities (not just CVSS rating).

We'll patch this vulnerability in due course, but please understand this may not be immediate based on the context of the vulnerability. If you would like to see this patched sooner and to contribute to the open source software ecosystem, the team would welcome any PRs to the repository.

Please feel free to reach out if you have any further questions or concerns.


My thoughts

All of the reported vulnerabilities have PRs against them. Some are still failing CI but it does feel a bit spicy to ask for paying customers to fix the product they're paying to use.

omonk avatar Nov 13 '24 09:11 omonk

For those who still wanted to resolve this, I was able to patch this by adding the following to my package.json:

  "overrides": {
    "@vercel/node": {
      "path-to-regexp": "8.2.0"
    }
  },

Can't promise I'll be able to open a PR 🙃, but definitely appreciate the open-source community!

joey-ma avatar Dec 19 '24 06:12 joey-ma

Tried following the Contributing Guidelines to open a PR, but it seems like there's quite a bit going on here. I'd imagine it'll take a while just to get past "Make sure all the tests pass before making changes."

Some things I've noticed: packages/functions/ had several no-undef eslint errors. image

Theoretically this should be fixable by changing the eslintConfig's parserOptions.ecmaVersion to 2020 and env.es2020 to true, but it didn't work for me here. Noticed there were also tons of packages in .eslintignore... but not packages/functions.

In addition, there were several failing unit tests as well. 🙃 Might be better for someone internal who's more familiar with the overall app + testing to take a look?

joey-ma avatar Dec 19 '24 17:12 joey-ma

@joey-ma if you're trying to do a PR patching path-to-regexp, I've already done that (#12131) and ~the team have been trying to get it landed~ looks like it's now been landed! 🎉 (#12734)

If you'd like to help out, I would recommend exploring upgrading tar in @vercel/fun (https://github.com/vercel/fun/issues/104) as that's had no attention and requires a major version bump through from my initial research it seemed like it should be safe to just do because the only breaking changes were in Node versions that @vercel/fun already has dropped support for.

edit: ok for path-to-regexp it seems it was patched for a short while but then the team decided they wanted to rollout some monitoring so they're reverted the upgrade: https://github.com/vercel/vercel/pull/12746

G-Rath avatar Dec 19 '24 18:12 G-Rath

Happy new year everyone!

I've updated this to reflect changes - namely:

  • path-to-regexp has changed: @vercel/node seems to no longer use it, but it is now being used by @vercel/remix-builder though at least it's the same version of @vercel/routing-utils so technically one instance of the vulnerability went away
  • debug and semver have been addressed: the cli is now finally using the updated version of @vercel/fun
  • esbuild has been added
  • undici has been added

G-Rath avatar Feb 10 '25 22:02 G-Rath

any news regarding path-to-regexp vulnerability? I'm still getting the message for this vulnerability via @vercel/routing-utils :)

wonderWoman1408 avatar Oct 30 '25 10:10 wonderWoman1408

any news regarding path-to-regexp vulnerability? I'm still getting the message for this vulnerability via @vercel/routing-utils :)

Sorry @wonderWoman1408 but I think Vercel are sticking pretty stubbornly to their position that they won't update dependencies.

chrisdenton-ct avatar Oct 30 '25 10:10 chrisdenton-ct

Vercel is not a trust worthy company regarding human rights, look at the recent news!

amerzad avatar Nov 17 '25 04:11 amerzad