Opening an encrypted pdf: the encryption dictionary's `StrF` and `StmF` are swapped
Categories
(Firefox :: PDF Viewer, defect, P1)
Tracking
()
People
(Reporter: battlechicken74, Assigned: calixte)
References
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0
Steps to reproduce:
Tried to open a pdf file.
- open attached file
- password is 'Hello'
- observe that the screen is empty
now, if you exchange the 2 variables in the pdf (with notepad++ for example)
/StmF /StdCF -> /StmF /Identity
/StrF /Identity -> /StrF /StdCF
then it works. -- a circle appears as intended
All other pdf reader apps that i tried work. (acrobat, sumatra)
Actual results:
Didn't open
Expected results:
Should have opened
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::PDF Viewer' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
| Assignee | ||
Comment 2•3 years ago
|
||
I can reproduce the issue in Firefox nightly on Windows 11.
It works correctly in either Acrobat or Foxit or Preview, but impossible to just open it in Edge.
| Assignee | ||
Comment 3•3 years ago
|
||
The CipherTransform ctor takes a string cipher ctor and a stream cipher ctor as arguments:
https://github.com/mozilla/pdf.js/blob/0c5afe9269f3f065bd4bdab37bb1322b0587673f/src/core/crypto.js#L1381
but the arguments are swaped when it's called:
https://github.com/mozilla/pdf.js/blob/0c5afe9269f3f065bd4bdab37bb1322b0587673f/src/core/crypto.js#L1860-L1867
Comment 4•3 years ago
|
||
Updated•3 years ago
|
Description
•