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

Fix CVE-2024-4367 #935

Merged
merged 2 commits into from
May 11, 2024
Merged

Conversation

make-github-pseudonymous-again
Copy link
Contributor

@make-github-pseudonymous-again make-github-pseudonymous-again commented May 11, 2024

@make-github-pseudonymous-again make-github-pseudonymous-again added the security This issue is about the overall security of the application label May 11, 2024
Copy link

codecov bot commented May 11, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 64.49%. Comparing base (499fcb7) to head (2d3e1ba).
Report is 2 commits behind head on main.

Files Patch % Lines
imports/lib/pdf/pdf.ts 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #935      +/-   ##
==========================================
+ Coverage   64.48%   64.49%   +0.01%     
==========================================
  Files         703      703              
  Lines        9705     9705              
  Branches     1335     1335              
==========================================
+ Hits         6258     6259       +1     
  Misses       3003     3003              
+ Partials      444      443       -1     
Flag Coverage Δ
test 69.78% <33.33%> (+0.01%) ⬆️
test-app 53.77% <33.33%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

By default, pdfjs-dist optimizes some path resolution logic by compiling
a JavaScript function on the fly. The function is built using string
concatenation and no effort is made at sanitizing the parts it is
built from. These parts could contain user-input which leads to a code
injection vulnerability. This commit disables this default behavior.
An alternative is to upgrade pdfjs-dist to v4.2.67 or later.

For reference, see:
  - https://bugzilla.mozilla.org/show_bug.cgi?id=1893645
  - https://www.cve.org/CVERecord?id=CVE-2024-4367
  - https://security.snyk.io/vuln/SNYK-JS-PDFJSDIST-6810403
  - GHSA-wgrm-67xf-hhpq
  - mozilla/pdf.js#18015
  - wojtekmaj/react-pdf#1786
  - https://security.stackexchange.com/questions/248462/\
    is-firefoxs-new-javascript-support-within-pdf-files-a-security-concern/\
    248985
  - https://stackoverflow.com/questions/49299000/\
    what-are-the-security-implications-of-the-isevalsupported-option-in-pdf-js
  - mozilla/pdf.js#10818

Not sure if this will break anything and/or will make certain things
slower.
Merged via the queue into main with commit 377dde0 May 11, 2024
22 checks passed
@make-github-pseudonymous-again make-github-pseudonymous-again deleted the security-CVE-2024-4367-1 branch May 11, 2024 20:58
@make-github-pseudonymous-again make-github-pseudonymous-again added the technology/pdf This has to do with leveraging the portable document format. label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security This issue is about the overall security of the application technology/pdf This has to do with leveraging the portable document format.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant