Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency pdfjs-dist to v4 [SECURITY] #5462

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 7, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
pdfjs-dist (source) 3.11.174 -> 4.2.67 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2024-4367

Impact

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

The patch removes the use of eval:
https://github.com/mozilla/pdf.js/pull/18015

Workarounds

Set the option isEvalSupported to false.

References

https://bugzilla.mozilla.org/show_bug.cgi?id=1893645


Release Notes

mozilla/pdf.js (pdfjs-dist)

v4.2.67

Compare Source

This release includes a new JPX decoder, based on OpenJPEG, which improves JPX image rendering performance and correctness. Moreover, this release contains improvements for the annotation editor, font conversion and the viewer.

Note that text selection boxes for some PDF files may overlap visually. This is a known issue that we currently track in https://github.com/mozilla/pdf.js/issues/17561.

Changes since v4.1.392

v4.1.392

Compare Source

This release features improvements, bugfixes and optimizations for accessibility, annotation rendering, annotation editing, font rendering, form handling, image rendering, text selection and the viewer.

Note that text selection boxes for some PDF files may overlap visually. This is a known issue that we currently track in #​17561.

Changes since v4.0.379


Configuration

📅 Schedule: Branch creation - "" in timezone Etc/UTC, Automerge - At any time (no schedule defined).

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


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot requested a review from a team as a code owner May 7, 2024 11:05
@renovate renovate bot added dependencies Pull requests that update a dependency file npm security This PR or issue mainly concerns security labels May 7, 2024
@thornbill thornbill added the blocked Requires work on the web client to finish label May 18, 2024
@renovate renovate bot force-pushed the renovate/npm-pdfjs-dist-vulnerability branch from 54915d4 to 6185ae1 Compare May 18, 2024 07:01
@jellyfin-bot
Copy link
Collaborator

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

@jellyfin-bot jellyfin-bot added the merge conflict Conflicts prevent merging label Jun 9, 2024
@renovate renovate bot force-pushed the renovate/npm-pdfjs-dist-vulnerability branch from 6185ae1 to cec9fe3 Compare June 9, 2024 07:05
@jellyfin-bot jellyfin-bot removed the merge conflict Conflicts prevent merging label Jun 9, 2024
Copy link

sonarqubecloud bot commented Jun 9, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@renovate renovate bot force-pushed the renovate/npm-pdfjs-dist-vulnerability branch from cec9fe3 to 2f74e98 Compare September 8, 2024 07:31
@thornbill thornbill force-pushed the renovate/npm-pdfjs-dist-vulnerability branch from 2f74e98 to 0bff493 Compare September 12, 2024 17:35
Copy link
Contributor Author

renovate bot commented Sep 12, 2024

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@thornbill thornbill removed the blocked Requires work on the web client to finish label Sep 12, 2024
Copy link

@@ -3,7 +3,8 @@
"modules": "false",
"files": "./dist/**/*.js",
"not": [
"./dist/libraries/pdf.worker.js",
"./dist/libraries/pdf.worker.mjs",
"./dist/node_modules.pdfjs-dist.*",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file includes dynamic imports that are only used in nodejs environments, so it should be safe to ignore.

// Disable for PDF.js XSS vulnerability
// https://github.com/mozilla/pdf.js/security/advisories/GHSA-wgrm-67xf-hhpq
isEvalSupported: false
url: downloadHref
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workaround is no longer required.

@@ -205,6 +208,7 @@ const config = {
path.resolve(__dirname, 'node_modules/markdown-it'),
path.resolve(__dirname, 'node_modules/material-react-table'),
path.resolve(__dirname, 'node_modules/mdurl'),
path.resolve(__dirname, 'node_modules/pdfjs-dist'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice any issues moving this back into our standard babel build, but is there anything specific that needs tested here @dmitrylyzo?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh, I don't remember. 😅
Maybe it's specific to that version of pdfjs?

At the moment, webOS 1.2 fails with SyntaxError: Use of reserved word 'import' (also tried it in the extra babel list).

case 2:
  _context5.next = 4;
  return import(/*webpackIgnore: true*/_this37.workerSrc);
case 4:

I'm using source-map in webpack.dev.conf, so it doesn't produce eval, which doesn't work in webOS 1.2.

Anyway, pdf.worker doesn't work because of ES6 features.
But it looks like pdfjs has some legacy variant (legacy/ folder).
No, that doesn't work either because of import. 😕

@jellyfin-bot
Copy link
Collaborator

Cloudflare Pages deployment

Latest commit 0bff49344f98a8a053dc163af57785acc8191da8
Status ✅ Deployed!
Preview URL https://425ac859.jellyfin-web.pages.dev
Type 🔀 Preview

@jellyfin-bot jellyfin-bot added the merge conflict Conflicts prevent merging label Sep 20, 2024
@jellyfin-bot
Copy link
Collaborator

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file merge conflict Conflicts prevent merging npm security This PR or issue mainly concerns security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants