Muhammad Abubakar
Muhammad Abubakar

Reputation: 11

How to handle path traversal vulnerability in webpack-dev-middleware with Vue CLI dependency constraints?

I'm dealing with a security vulnerability in webpack-dev-middleware reported as CVE-2024-29180, which involves insufficient URL validation that allows path traversal attacks. Dependabot flagged this issue but cannot update webpack-dev-middleware to a non-vulnerable version due to conflicting dependencies in my project that uses Vue CLI.

The specific conflict arises because @vue/[email protected] requires webpack-dev-middleware@^3.7.2 via [email protected], and the fixed version for the vulnerability starts from 5.3.4.

Given this dependency chain, updating to a secure version seems non-trivial. Here’s more detail on the vulnerability:

  1. Affected versions: <= 5.3.3
  2. Patched version: 5.3.4

Questions:

Upvotes: 1

Views: 1149

Answers (1)

Nabin Shrestha
Nabin Shrestha

Reputation: 11

I resolved this issue by simply upgrading the webpack-dev-middleware package. It suggests that the package is vulnerable below or equal to the 5.3.3 version.

npm install [email protected] -D

And put the package to the overrides in package.json enter image description here

NOTE: After adding this please delete node_modules and package-lock.json and reinstall

Upvotes: 0

Related Questions