Attention Needed - Certain vulnerabilities necessitate manual review for resolution

npm audit

                       === Security Report from npm audit ===                        

# You have 1 vulnerability that can be resolved by running `npm update terser-webpack-plugin --depth 3`

  Severity        Issue                                          

  Package         serialize-javascript                                          

  Dependency of   @angular-devkit/build-angular [dev]                           

  Path            @angular-devkit/build-angular > webpack >                     
                  terser-webpack-plugin > serialize-javascript                  

  More Information       https://npmjs.com/advisories/1426                             




                                 Manual Review Required                                
             Some vulnerabilities need your attention to be resolved             

          Visit https://go.npm.me/audit-guide for further guidance           


  Severity        Issue                                          

  Package         serialize-javascript                                          

  Patched in      >=2.1.1                                                       

  Dependency of   @angular-devkit/build-angular [dev]                           

  Path            @angular-devkit/build-angular > copy-webpack-plugin >         
                  serialize-javascript                                          

  More Information       https://npmjs.com/advisories/1426                             


  Severity        Issue

  Package         serialize-javascript

  Patched in      >=2.1.1

  Dependency of   @angular-devkit/build-angular [dev]

  Path            @angular-devkit/build-angular > terser-webpack-plugin >
                  serialize-javascript

  More Information       https://npmjs.com/advisories/1426

found 3 moderate severity vulnerabilities in 18591 scanned packages
  run `npm audit fix` to fix 1 of them.
  2 vulnerabilities require manual review. See the full report for details.

package.json

{
  "name": "client",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  ...
  // Omitted for brevity
  ...

Cross-Site Scripting serialize-javascript

npm doc: https://www.npmjs.com/advisories/1426

The documentation states:

Overview

Versions of serialize-javascript before 2.1.1 are susceptible to Cross-Site Scripting (XSS) attacks. The package does not properly sanitize serialized regular expressions. Note that this vulnerability does not impact Node.js applications.

Remediation

Upgrade to version 2.1.1 or later.

Even though I don't use serialize-javascript in my package.json file. How should I address this?

Answer №1

Response from OP

We also need to include the following:

"scripts": {
    "preinstall": "npx npm-force-resolutions"
}

New Information

This issue appears to be connected to a dependency in Angular, which seems relatively new. It is possible that the Angular Team will address it soon. In the meantime, you can try to resolve the dependency yourself.

To start, you will require assistance from a third-party tool: https://github.com/rogeriochaves/npm-force-resolutions

Next, update your package.json with the following:

 "resolutions": {
    "serialize-javascript": "^2.1.1"
  }

Lastly:

rm -r node_modules
npx npm-force-resolutions
npm install

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips for obtaining the Component instance from the ViewContainerRef.get() method for dynamically created components

Explanation of my current goal successfully add components to a ViewContainerRef (completed) initialize these dynamic components with properties (done) gain access to the dynamically created Component instances for decision-making purposes. The issue at ...

What is the best way to prevent images from being loaded with broken links?

Currently, I am working on a new feature that involves rendering images from servers. In the process of aligning these images, I noticed an excessive amount of white space due to loading images with broken links. https://i.stack.imgur.com/jO8BR.png Here ...

Contrast between npm run dev and npm run production

As a beginner in Laravel and Vue.js, I'm curious to learn about the distinction between running npm run dev and npm run production. Could someone explain if this is related to the environment? ...

What is the integration process of using Font Awesome with React?

After installing react-create-app using npm, I also added react-fontawesome. Now, I'm wondering how to include the css styles of fontawesome in my project? Here is a glimpse of my work space: https://i.stack.imgur.com/pM1g1.png ...

Issue with Angular 7 Universal: components inside are failing to display

I have successfully implemented Angular 7 Universal with dynamic server-side rendering. However, I am facing an issue where dynamic components within the main component being rendered on the server are not rendered themselves. Here is an example of the re ...

Retrieving the value of a checkbox when clicked in Angular 2

I am trying to use ngModel binding to check the status of a checkbox. After calling console.log(activeCheckbox);, I can see that the ngmodel and its value property are set to true in the console. However, when I immediately call console.log(activeCheck ...

Incorporating a jQuery feature into Angular 6

Encountering issues while trying to integrate a jQuery cascading dropdown feature into my Angular 6 project. An error occurred when attempting to execute ng serve: Error: ENOENT: no such file or directory, open C:\nodeprojects\node_modules&b ...

What is the best way to retrieve the value from a chosen radio button?

Here is the HTML code snippet: <ion-list radio-group [(ngModel)]="portion" (ionChange)="getPortionType()"> <ion-list-header> Select Portion </ion-list-header> <ion-item *ngFor="let item of porti ...

The Angular 2 Final Release is encountering an issue where it is unable to locate the module name with the

Recently, I made the transition to Angular 2 Final Release from RC 4 and encountered an issue with an error message cannot find name 'module' in my code: @Component({ selector: 'dashboard', moduleId: module.id, templateUrl: ...

Show Data from API on Angular 6 Webpage

Hello everyone, I am a beginner in the world of frontend development and I'm currently facing a challenge with displaying API data in an Angular 6 application. I have managed to showcase values from the main level of the returned details, but I am str ...

What is the best way to dynamically update styleUrls or style properties in Angular?

One of my goals is to give users the ability to customize colors and certain styles within my Angular application. I am thinking about creating a structure like this: Structure: component-one   folder-with-css-files     style-for-component-1-fo ...

Assets failing to duplicate during ng build in production

Currently, I'm developing an application using Angular 4. I recently added a new SVG image to the assets/images folder and made the necessary changes in the angular-cli.json file as well. When I run 'ng build' locally, it successfully copies ...

Is it feasible to utilize mat-selection-list with an object instead?

I've been exploring the mat-selection-list feature available in the material.angular.io documentation at material.angular.io/components/list/overview Instead of using a string array, I'm aiming to utilize an array of objects. The documentation c ...

Tips for embedding an Angular application within another Angular application

I am working on two Angular projects at the moment. The first one is named App1, while the second one is called Angular Form Editor. My goal is to integrate the Form Editor into the App1 project. What steps should I take in order to achieve this integrat ...

Error encountered: Excelption - ENOENT - The specified file or directory does not exist: lstat node

I've been working on an Angular 12 application without any issues, but recently I encountered an error when trying to run it using ng serve. I've tried numerous solutions found on different websites, but nothing seems to work. I even went as far ...

Transmitting multiple parameters, including a file, from Angular to Spring framework

I am attempting to send an http request with multiple parameters to Spring. One of the parameters is a file, but I keep receiving a bad request error from the server. I am confident that I have made a mistake somewhere, and I would appreciate your assistan ...

Localizing node modules is essential for enhancing performance and efficiency within

When it comes to working with modules already registered on NPM, the process of including them is quite simple: just run npm install <package> and then add var package = require('<package>') However, I am a bit unsure of how to get t ...

Transform the code provided by bundleMDX into an HTML string specifically for RSS, all the while utilizing the mdx-bundler

I am currently working on developing an RSS reader and I need to convert the code returned by bundleMDX into a string. This is necessary so that I can utilize it with ReactDOMServer.renderToStaticMarkup(mdx) in my project. You can find a similar implement ...

Do we really need TypeScript project references when transpiling with Babel in an Electron project using Webpack?

Currently, I am in the process of setting up my project configuration and have not encountered any errors so far. However, based on my understanding of the Typescript documentation... It appears that Project references are not essential when using babel-l ...

404 Error: Unable to Locate Socket Io

I'm currently working on implementing a chat feature in Angular 2 using Socket IO, following this tutorial. However, I encountered an error message during a test on the server: GET http://localhost:3000/socket.io/?EIO=3&transport=polling& ...