Angular-cli: NPM Audit Failure = @angular-devkit/build-angular

Created on 11 Apr 2019  Β·  47Comments  Β·  Source: angular/angular-cli

🐞 Bug report

Command (mark with an x)

  • [ X ] new
  • [ ] build
  • [ ] serve
  • [ ] test
  • [ ] e2e
  • [ ] generate
  • [ ] add
  • [ ] update
  • [ ] lint
  • [ ] xi18n
  • [ ] run
  • [ ] config
  • [ ] help
  • [ ] version
  • [ ] doc
    ```

Is this a regression?

no

Description

Up to date NG CLI, creating a new project, npm audit strikes

πŸ”¬ Minimal Reproduction

Up to date NG CLI, creating a new project, npm audit strikes

πŸ”₯ Exception or Error


β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                Manual Review                                 β”‚
β”‚            Some vulnerabilities require your attention to resolve            β”‚
β”‚                                                                              β”‚
β”‚         Visit https://go.npm.me/audit-guide for additional guidance          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ High          β”‚ Arbitrary File Overwrite                                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Package       β”‚ tar                                                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Patched in    β”‚ >=4.4.2                                                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Dependency of β”‚ @angular-devkit/build-angular [dev]                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Path          β”‚ @angular-devkit/build-angular > node-sass > node-gyp > tar   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ More info     β”‚ https://npmjs.com/advisories/803                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🌍 Your Environment


Angular CLI: 7.3.8
Node: 10.15.0
OS: darwin x64
Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.13.8
@angular-devkit/core         7.3.8
@angular-devkit/schematics   7.3.8
@schematics/angular          7.3.8
@schematics/update           0.13.8
rxjs                         6.3.3
typescript                   3.2.4

Anything else relevant?
Nothing further

devkibuild-angular high security bufix

Most helpful comment

This question has already been answered. Can you try this solution https://stackoverflow.com/a/55649551/10961281, it has worked for me

Do NOT manually edit the lock file.

All 47 comments

Hi, thanks for reporting this, however this is caused by an upstream package and will be fixed when they release a new version https://github.com/nodejs/node-gyp/issues/1714

I am having the same issue.

v4.4.8 was just released.

Looks like node-gyp already took care of it.
https://github.com/nodejs/node-gyp/pull/1713

Im guessing with it now being resolved we can expect this in the next release?

Building a new app still generates the same error

node-sass are using an older version of node-gyp. hence we are still blocked on this.

See: https://github.com/sass/node-sass/issues/2625

This question has already been answered. Can you try this solution https://stackoverflow.com/a/55649551/10961281, it has worked for me

This question has already been answered. Can you try this solution https://stackoverflow.com/a/55649551/10961281, it has worked for me

Do NOT manually edit the lock file.

This question has already been answered. Can you try this solution https://stackoverflow.com/a/55649551/10961281, it has worked for me

Do NOT manually edit the lock file.

Then how should it be done?

Wait till sass is updated and give the angular chaps time, it's friday (for us anyway) We aren't releasing this weekend.

The Angular guys are extremely quick at resolving issues, patience is key.

+1

I am also having this issue, any news on an update?

I also have this problem. We wait few days with merges.

Any update on this?

Hi all, node-sass have yet to fix the issue see: https://github.com/sass/node-sass/issues/2625
At this point we are blocked until they do the fix and cut a release.

Our CI pipe lines throwing this vulnerability, so what is ETA of this Issue?

Check out nodejs/node-gyp#1718 for an ETA on the next node-gyp release containing a fix. At this stage, it looks like they're still debating what version number to give it. :expressionless:

https://github.com/sass/node-sass/pull/2639
node-gyp has been fixed
node-sass is bing updated:
Once that PR is merged we can bump the node-sass version here

Is it safe to use the CLI to build for production apps while we're waiting on a fix?

Any update on this, there has been a cli update but the error is still persisting?

@pl4yradam, sass/node-sass#2639 still needs to be merged. See https://github.com/angular/angular-cli/issues/14138#issuecomment-486388458.

@MatthiasKunnen thanks for the ref mate, I'll keep an eye out over there

any update?

The solution of this question solved my problem too, but don't know how safe/recommended is it?
https://stackoverflow.com/questions/55635378/npm-audit-arbitrary-file-overwrite/55649551#55649551

The solution of this question solved my problem too, but don't know how safe/recommended is it?
https://stackoverflow.com/questions/55635378/npm-audit-arbitrary-file-overwrite/55649551#55649551

This is not the way to do it. Manually editing the package-lock.json file to fix the dependency version seems like a quick fix but it's not the right fix since the package-lock file will be overwritten when you run a npm install again. Guess we should wait on the devs to bump up the dependency version of node-sass and then update this package.

any updates?

any updates?

any updates? cannot wait for the right solution.

still waiting for an apropriate solution :(

Any ETA on this as our CI builds complain about this vulnerability.

@subhashkonda @art3miz18 @pl4yradam @IsAmrish @pablocid I think it's safe to say if you still see the blocked tag on this issue, they are unable to execute work to fix it. Keep an eye on the fixes this work is dependent on, it's all been documented above what is needed for the Angular team to do what they need to do.

@MacGyver214 im not sure why I have been tagged as I was providing a link to the issue?

Hi! It's gonna be fix this issue soon? Thanks!
Angular-cli messages code errors not showing becouse this issue.

For those wondering why fixing this issue takes so long, have a look at https://github.com/npm/node-tar/pull/213 : they are facing a corner case where updating a library might cause more problems than leaving the security breach open.

Let’s hope someone will find a way to solve this. :)

New version of tar just has been released:
https://github.com/npm/node-tar/issues/212#issuecomment-492463507

Node-sass:
https://github.com/sass/node-sass/issues/2625#issuecomment-492464554

Closing the issue as this seems to have been fixed upstream without the need to do any changes from our side.

Yes! I just did: npm audit fix and solved!

Npm audit fix fixed all issues in my local, but I still see in my CI build showing the tar 2.2.2 high vulnerability. Do you see the issue is still open or is this seems to be my CI Build specific.
Does anyone facing the same ?

@subhashkonda i am also facing the same issue with github. Veulnerability fixed on my local but Github still shows it vulnerable. They might need some more time to update their audit list :).

@alan-agius4 do you know when the dependency will be updated, and a new version of @angular-devkit/build-angular will be released on version 7 (stable)?

@xaviergxf, I don't think they need a new release for this issue since it's been fixed upstream.

Indeed no release is needed from our side.

27 May 2019 - Still facing the same issue when creating new Angular project via CLI - ___12___ high vulnerabilities found.

The following solved it for me:

npm i -D node-sass node-pre-gyp node-gyp tar

I still have this same issue in CI Builds but in local it is all fine npm audit gives 0 vulnerabilities, So what can be done here???

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gotschmarcel picture gotschmarcel  Β·  3Comments

IngvarKofoed picture IngvarKofoed  Β·  3Comments

jmurphzyo picture jmurphzyo  Β·  3Comments

hartjo picture hartjo  Β·  3Comments

rajjejosefsson picture rajjejosefsson  Β·  3Comments