You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If PDF.js is used to load a malicious PDF, and PDF.js is configured with isEvalSupported set to true (which is the default value), unrestricted attacker-controlled JavaScript will be executed in the context of the hosting domain.
Patches
This patch forces isEvalSupported to false, removing the attack vector.
Workarounds
Set options.isEvalSupported to false, where options is Document component prop.
Improved developer experience by moving prop documentation to JSDoc. This means that you can now see descriptions, default values, and examples for all props in your IDE.
Added Thumbnail component which lets you render thumbnails (#898, #1519).
Forms rendered by annotation layer are now using AnnotationStorage. This allows you to hook into pdf.annotationStorage in pdf provided in onDocumentLoadSuccess callback and listen for form data changes (#1518). Thanks, @kostassite!
New hooks: useDocumentContext, useOutlineContext and usePageContext. These hooks allow you to build custom components that hook (pun not intended) into React-PDF API (#1505). Thanks, @iamandrewluca!
If onItemClick was not provided neither to Document nor Outline components, React-PDF will now attempt to navigate to the page of the clicked outline item on its own, just like it does for internal links.
What's changed?
Improved accessibility by introducing structure tree. This also introduces new props in Page: onGetStructTreeSuccess and onGetStructTreeError (#1494, #1498). Thanks, @MattL75!
Bug fixes
Fixed onItemClick types incorrectly marking dest as required.
Fixed onItemClick not passed from Document to Outline. Previously, you had to manually pass onItemClick to Outline component. Now, you only need to pass it to Document.
This is one of the biggest update - for React-PDF and for me personally. React-PDF has been rewritten from scratch using TypeScript and React Hooks. I've put a tremendous amount of effort to modernize the package without introducing any major breaking changes. If, however, something have slipped through 137 unit tests we have, please let me know. I hope you will like it.
Note: React <16.8 is not supported. If you're still using React older than 16.8, please use react-pdf@^5.0.0 instead.
❗️ = breaking change
What's new?
❗️ Vastly improved performance and bundle size thanks to the modern version of PDF.js that is now used. This drops support for legacy browsers. See README for details.
Added new Webpack 5-specific entry file. It uses Webpack's new URL assets instead of worker-loader, which turned out to be quite problematic in the past. Don't worry, if you want to stick to the old Webpack-specific one, it should still work just fine!
renovateBot
changed the title
fix(deps): update dependency react-pdf to v7 [security]
fix(deps): update dependency react-pdf to v8 [security]
May 10, 2024
renovateBot
changed the title
fix(deps): update dependency react-pdf to v8 [security]
fix(deps): update dependency react-pdf to v7 [security]
May 11, 2024
renovateBot
changed the title
fix(deps): update dependency react-pdf to v7 [security]
fix(deps): update dependency react-pdf to v8 [security]
May 23, 2024
renovateBot
changed the title
fix(deps): update dependency react-pdf to v8 [security]
fix(deps): update dependency react-pdf to v7 [security]
May 24, 2024
renovateBot
changed the title
fix(deps): update dependency react-pdf to v7 [security]
fix(deps): update dependency react-pdf to v9 [security]
Jun 5, 2024
renovateBot
changed the title
fix(deps): update dependency react-pdf to v9 [security]
fix(deps): update dependency react-pdf to v7 [security]
Jun 5, 2024
renovateBot
changed the title
fix(deps): update dependency react-pdf to v7 [security]
fix(deps): update dependency react-pdf to v9 [security]
Jun 12, 2024
renovateBot
changed the title
fix(deps): update dependency react-pdf to v9 [security]
fix(deps): update dependency react-pdf to v7 [security]
Jun 12, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^4.0.5→^7.0.0react-pdf vulnerable to arbitrary JavaScript execution upon opening a malicious PDF with PDF.js
CVE-2024-34342 / GHSA-87hq-q4gp-9wr4
More information
Details
Summary
If PDF.js is used to load a malicious PDF, and PDF.js is configured with
isEvalSupportedset totrue(which is the default value), unrestricted attacker-controlled JavaScript will be executed in the context of the hosting domain.Patches
This patch forces
isEvalSupportedtofalse, removing the attack vector.Workarounds
Set
options.isEvalSupportedtofalse, whereoptionsisDocumentcomponent prop.References
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
wojtekmaj/react-pdf (react-pdf)
v7.7.3Compare Source
Bug fixes
isEvalSupportedtofalse. Fixes GHSA-87hq-q4gp-9wr4 (caused by GHSA-wgrm-67xf-hhpq).v7.7.2Compare Source
This version shipped an incorrect fix for a security vulnerability and thus has been deprecated.
Bug fixesForceisEvalSupportedtotrue. Fixes GHSA-87hq-q4gp-9wr4 (caused by GHSA-wgrm-67xf-hhpq).v7.7.1Compare Source
Bug fixes
Outline,PageandThumbnailcomponents crashing when placed outsideDocument, but provided withpdfprop (#1709).vite-plugin-static-copysuggesting a solution that doesn't work on Windows.v7.7.0Compare Source
What's new?
What's changed?
renderModeis deprecated and will be removed in the future.tiny-warningwith more popular (and equally tiny!)warning.v7.6.0Compare Source
What's new?
v7.5.1Compare Source
What's new?
v7.5.0Compare Source
What's new?
PasswordResponsestype to make it easier to create custom password prompts (#1615). Thanks, @pstevovski!optionsprop and usage with Next.js.Bug fixes
v7.4.0Compare Source
What's new?
Bug fixes
index.test.jsentry not working in pure ESM mode with "moduleResolution": "node16" TypeScript option enabled.v7.3.3Compare Source
Bug fixes
v7.3.2Compare Source
Bug fixes
v7.3.1Compare Source
Bug fixes
v7.3.0Compare Source
What's new?
What's changed?
Bug fixes
v7.2.0Compare Source
What's new?
renderMode:"custom". When set, you can pass custom renderer function tocustomRendererprop (#1408).'use client';to the parent component for this component to work.What's changed?
optionsprop value (#1567).Bug fixes
@types/reactand@types/react-domare now optional peerDependencies, which eliminates errors caused by duplicate typings.v7.1.3Compare Source
What's changed?
clsxdependency to2.0.0to enable ESM support in the near future.v7.1.2Compare Source
Bug fixes
customTextRenderernot working on documents without marked content (#1530, #1531). Thanks, @MattL75!v7.1.1Compare Source
Bug fixes
v7.1.0Compare Source
Large and exciting release, full of improvements and new features, mainly thanks to our contributors, @kostassite, @iamandrewluca and @MattL75, and sponsors. Become a sponsor and help making React-PDF even better!
What's new?
Thumbnailcomponent which lets you render thumbnails (#898, #1519).pdf.annotationStorageinpdfprovided inonDocumentLoadSuccesscallback and listen for form data changes (#1518). Thanks, @kostassite!useDocumentContext,useOutlineContextandusePageContext. These hooks allow you to build custom components that hook (pun not intended) into React-PDF API (#1505). Thanks, @iamandrewluca!onItemClickwas not provided neither toDocumentnorOutlinecomponents, React-PDF will now attempt to navigate to the page of the clicked outline item on its own, just like it does for internal links.What's changed?
Page:onGetStructTreeSuccessandonGetStructTreeError(#1494, #1498). Thanks, @MattL75!Bug fixes
onItemClicktypes incorrectly markingdestas required.onItemClicknot passed fromDocumenttoOutline. Previously, you had to manually passonItemClicktoOutlinecomponent. Now, you only need to pass it toDocument.v7.0.3Compare Source
Bug fixes
DocumentInitParametersto be passed tooptionsprop.v7.0.2Compare Source
Bug fixes
sectionselector styled.v7.0.1Compare Source
Bug fixes
v7.0.0Compare Source
See Upgrade guide from version 6.x to 7.x.
This is one of the biggest update - for React-PDF and for me personally. React-PDF has been rewritten from scratch using TypeScript and React Hooks. I've put a tremendous amount of effort to modernize the package without introducing any major breaking changes. If, however, something have slipped through 137 unit tests we have, please let me know. I hope you will like it.
❗️ = breaking change
What's new?
What's changed?
renderInteractiveFormsprop.Bug fixes
--scale-factorCSS-variable must be set" error.v6.2.2Compare Source
Bug fixes
v6.2.1Compare Source
What's changed?
pageIndexandpageNumberincustomTextRendererargs that, despite undocumented, may have been used by some (#1190).typeof windowchecks withtypeof documentchecks to avoid Deno environment being falsely recognized as browser environment.Bug fixes
onItemClickcallback working only once per item (#997, #1192).v6.2.0Compare Source
What's new?
devicePixelRatioprop in Page component.Bug fixes
itemIndexto thecustomTextRenderer(#1183). Thanks, @paescuj!v6.1.1Compare Source
Bug fixes
customTextRendererand if textContent items have both text and line break (#1173).v6.1.0Compare Source
What's new?
v6.0.3Compare Source
Bug fixes
customTextRenderercalled too often and potentially with undefinedstr(#1151).v6.0.2Compare Source
Bug fixes
v6.0.1Compare Source
Bug fixes
v6.0.0Compare Source
See Upgrade guide from version 5.x to 6.x.
Note: React <16.8 is not supported. If you're still using React older than 16.8, please use react-pdf@^5.0.0 instead.
❗️ = breaking change
What's new?
onRenderTextLayerErrorandonRenderTextLayerSuccessonRenderTextLayerErrorproponRenderTextLayerSuccessprop.What's changed?
onGetTextSuccessis now called with an object containingitemsandstyles.TextLayer.cssnow must be imported manually for TextLayer to work properly.customTextRenderer(#1124).file-loaderis now an optional peerDependency (#970). Thanks, @rpaasche!merge-class-nameswithclsx.Bug fixes
renderInteractiveFormsprop ignored. Thanks, @liquidautumn!v5.7.2Compare Source
What's new?
Bug fixes
canvasrendering mode (default) when using React 18 w. StrictMode on (#972).v5.7.1Compare Source
What's changed?
renderInteractiveFormsoption withannotationModeinpage.rendercall (#946).Bug fixes
workerPortinstead ofworkerSrcin Parcel 2 specific entry (#941). Thanks, @jamesjessian!v5.7.0Compare Source
Biggest one in months!
What's new?
worker-loader, which turned out to be quite problematic in the past. Don't worry, if you want to stick to the old Webpack-specific one, it should still work just fine!externalLinkRelprop.destandpageIndextoonItemClickcallbacks (#812, #924). Thanks, @malwilley!What's changed?
pdf.worker.js.v5.6.0Compare Source
What's new?
v5.5.0Compare Source
What's new?
canvasBackgroundprop (#851). Thanks, @paescuj!v5.4.1Compare Source
Bug fixes
v5.4.0Compare Source
What's new?
Bug fixes
v5.3.2Compare Source
Bug fixes
fileprop type checker not acceptingdataas string (#800).v5.3.1Compare Source
What's changed?
Bug fixes
onLoadProgressincorrectly listed asPageprop in README.v5.3.0Compare Source
What's new?
What's changed?
Bug fixes
v5.2.0Compare Source
What's new?
imageResourcesPath(#728). Thanks, @hchevalier!v5.1.0Compare Source
What's new?
v5.0.0Compare Source
❗️ = breaking change
What's new?
What's changed?
Bug fixes
error,loading,noDatapropTypes not accepting functions (#579).dir="rtl"(#588).Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.