Comments (5)
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.
Hello! Any solution to this?
from ng2-pdf-viewer.
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.
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.
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)
- Can't show pdf error ERR_CERT_DATE_INVALID HOT 3
- Thumbnail View I have shown up but scroll issue happned
- Range requests / partial responses do not work in chrome
- Anchor-link in PDF file.
- PDF.js vulnerable to arbitrary JavaScript execution upon opening a malicious PDF HOT 13
- ng-pdf-viewer showing black screen HOT 2
- How I can acess RenderParameters from pdf.js
- Update pdfjs-dist to 4.2.67 or later HOT 10
- TS2304: Cannot find name 'WeakKey'. HOT 7
- scrollPageIntoView: "1" is not a valid pageNumber parameter.
- Whats the recommended version to use with angular 15 ?
- (page-rendered)="pdfPageRendered2($event)" event is not working as expected with angular 16.2.12 & ng2-pdf-viewer v^9.1.5
- Cannot find name 'WeakKey'. version 10.2.2 HOT 8
- No loader is configured for ".node" files: node_modules/canvas/build/Release/canvas.node HOT 1
- Bug: Selected text from PDF is not copied to clipboard. HOT 4
- Missing Release of Resource after Effective Lifetime
- [DELETED]
- Open Document in a New Browser Tab/Window
- Critical Security Vulnerability in dependency package "pdfjs" HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng2-pdf-viewer.