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

@angular-devkit/build-angular depends on vulnerable version of webpack-dev-middleware #27334

Closed
1 task
JainDhaval opened this issue Mar 22, 2024 · 18 comments · Fixed by #27335, #27336, #27319 or #27337
Closed
1 task

Comments

@JainDhaval
Copy link

Command

new

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Running npm audit on Angular v16 project causes an error output, because @angular-devkit/build-angular depends on vulnerable version of webpack-dev-middleware.
See more details: GHSA-wr3j-pwj9-hqq6

Minimal Reproduction

Create new Angular v16 project.
Run npm audit in the project folder

Exception or Error

No response

Your Environment

Angular CLI: 16.2.10
Node: 18.18.1
Package Manager: npm 10.2.0
OS: win32 x64

Angular: 16.2.12
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1602.10
@angular-devkit/build-angular   16.2.12
@angular-devkit/core            16.2.10
@angular-devkit/schematics      16.2.10
@angular/cli                    16.2.10
@schematics/angular             16.2.10
rxjs                            7.8.1
typescript                      4.9.5
zone.js                         0.13.3

Anything else relevant?

No response

@alan-agius4 alan-agius4 self-assigned this Mar 22, 2024
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Mar 22, 2024
…o `6.1.2`

Addressed in this commit is an update to `webpack-dev-middleware` to version `6.1.2`, resolving a security concern identified at GHSA-wr3j-pwj9-hqq6.

Closes angular#27334
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Mar 22, 2024
…o `6.1.2`

Addressed in this commit is an update to `webpack-dev-middleware` to version `6.1.2`, resolving a security concern identified at GHSA-wr3j-pwj9-hqq6.

Closes angular#27334
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Mar 22, 2024
…o `6.1.2`

Addressed in this commit is an update to `webpack-dev-middleware` to version `6.1.2`, resolving a security concern identified at GHSA-wr3j-pwj9-hqq6.

Closes angular#27334
@kdemetter
Copy link

kdemetter commented Mar 22, 2024

I'm also having this on Angular v17

clydin pushed a commit that referenced this issue Mar 22, 2024
…o `6.1.2`

Addressed in this commit is an update to `webpack-dev-middleware` to version `6.1.2`, resolving a security concern identified at GHSA-wr3j-pwj9-hqq6.

Closes #27334
alan-agius4 added a commit that referenced this issue Mar 22, 2024
…o `6.1.2`

Addressed in this commit is an update to `webpack-dev-middleware` to version `6.1.2`, resolving a security concern identified at GHSA-wr3j-pwj9-hqq6.

Closes #27334
@alan-agius4
Copy link
Collaborator

alan-agius4 commented Mar 22, 2024

Fixed via #27335, #27336 and #27319

@ojpbay
Copy link

ojpbay commented Mar 22, 2024

When will the fix be released?

clydin pushed a commit that referenced this issue Mar 22, 2024
…o `6.1.2`

Addressed in this commit is an update to `webpack-dev-middleware` to version `6.1.2`, resolving a security concern identified at GHSA-wr3j-pwj9-hqq6.

Closes #27334
@Dark-Light-20
Copy link

I see that @alan-agius4 comments that this issue is fixed from 3 PRs, but i don't see a PR for the branch 15.2.x to solve the issue on Angular 15 LTS.

@alan-agius4
Copy link
Collaborator

Version 15 PR #27337

@Dark-Light-20
Copy link

Version 15 PR #27337

Thanks 😸

@grenmath
Copy link

where is the new angular 15.2.11 ? i dont understand if merged 6.1.2 and how get this updted package in 15.2.10 ?

@alan-agius4
Copy link
Collaborator

Fix has been released in versions 15.2.11, 16.2.13, and 17.3.2.

@emandere
Copy link

Will the Webpack-dev-server be updated from 4.15.1 to 4.15.2? The 4.15.1 version references a vulnerable version of the webpack-dev-middleware library and version 4.15.2 fixes that

@alan-agius4
Copy link
Collaborator

@emandere, please update your lock file which will resolve the issue.

@WellingtonBraga
Copy link

HI @alan-agius4 ,

We have this vulnerability on build-angular version 15.2.11. The webpack-dev-middleware as direct dependency was updated in its package.json, but the webpack-dev-server is still demanding a vulnerable version of the middleware. Are you guys planning to do something about that?

Regards,
Wellington B.

@JeanMeche
Copy link
Member

build-angular pulls webpack-dev-server:4.15.1 which then pulls webpack-dev-middleware: ^5.3.1.

The 5.3.4 is doesn't have the vulnerability. So you should be able to update it.

@WellingtonBraga
Copy link

Hi @JeanMeche , thanks for the answer.

I believe you must be talking about the 16+ versions of build-angular which are, as you said, pulling the version of webpack-dev-server that has fixed the vulnerability. However, I'm taking about version 15.2.11 of it, which still has the vulnerability.

It seems we fixed the direct dependency version in this commit, but given webpack-dev-server wasn't updated, the vulnerability seems to be still around.

I'm wondering if we have plans to fix the vulnerability and release it a new 15x version. Can you please help me with that?

Regards,
Wellington B.

@JeanMeche
Copy link
Member

JeanMeche commented Apr 3, 2024

I was talking about v15.

If you deletepackage-lock.json / node_modules , npm will load webpack-dev-middleware: 5.3.4.

@WellingtonBraga
Copy link

Hi @JeanMeche , Thanks again for the answer.

Removing yarn.lock isn't something we should do. Is there no plan at the moment to have an official fix for that aside of the one mentioned?

In case the answer is no, then maybe resolutions may help, but it's also something we don't usually do.

Sorry for bombed you with questions.

Regards,

@HelenaSeatCode
Copy link

HelenaSeatCode commented Apr 23, 2024

Hi, @alan-agius4, @JeanMeche !!!
Is it possible to fix this for branch 14.2.x to solve the issue on Angular 14?
Regards,
Helena

@alan-agius4
Copy link
Collaborator

@HelenaSeatCode, version 14 is end-of-life. Please see https://angular.io/guide/releases#actively-supported-versions

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.