Coder Social home page Coder Social logo

Comments (5)

antonio-santos-zact avatar antonio-santos-zact commented on July 23, 2024 2

I also found that same vulnerability when running npm audit

pdfjs-dist <=4.1.392
Severity: high
PDF.js vulnerable to arbitrary JavaScript execution upon opening a malicious PDF - [GHSA-wgrm-67xf-hhpq](https://github.com/advisories/GHSA-wgrm-67xf-hhpq)
No fix available
node_modules/pdfjs-dist
ng2-pdf-viewer *
Depends on vulnerable versions of pdfjs-dist
node_modules/ng2-pdf-viewer

from ng2-pdf-viewer.

arielpetri avatar arielpetri commented on July 23, 2024

Hello! Any solution to this?

from ng2-pdf-viewer.

RobJacobs avatar RobJacobs commented on July 23, 2024

To get around this, I added the following to my package.json:

  "overrides": {
    "ng2-pdf-viewer": {
      "pdfjs-dist": "^4.3.136"
    }
  }

then in the consuming component I had to override the pdfWorkerSrc variable:

constructor() {
  (window as any).pdfWorkerSrc = 'https://cdn.jsdelivr.net/npm/[email protected]/legacy/build/pdf.worker.min.mjs';
}

from ng2-pdf-viewer.

arielpetri avatar arielpetri commented on July 23, 2024

Thank you! But it doesn't compile when I do that.
It gives me the following error:
Error: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.component.d.ts:7:37 - error TS2307: Cannot find module 'pdfjs-dist/web/pdf_viewer' or its corresponding type declarations.

I have the version:
"ng2-pdf-viewer": "^10.2.2",

and
"overrides": {
"ng2-pdf-viewer": {
"pdfjs-dist": "^4.3.136"
}
}

Any suggestions or something I'm missing?

Thanks again!

from ng2-pdf-viewer.

shamoon avatar shamoon commented on July 23, 2024

I suggest folks here read the release notes and relevant PRs, the security issue was closed but the pdfjs package itself wasn’t updated all the way so automated alerts like this won’t go away (perhaps they can be dismissed another way, I don’t know). This project is not currently compatible with pdfjs 4.x to my knowledge so the security issue was closed by another valid published means

from ng2-pdf-viewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.