Description of problem: When we save password protected files using .xlsx format, it can be reopened with libreoffice without entering password and can lead to data loss and data theft.
Version-Release number of selected component (if applicable): libreoffice-22.214.171.124-3
How reproducible: Always
Steps to Reproduce:
1. Create a Calc/Writer doc with data
2. In the "Save as" dialog box, select "Save with Password" & Format as ".xlsx"
3. Save the sheet & try reopening it
4. When prompted for password, Press "Cancel"
5. The sheet still opens up with encrypted data and can be edited and saved again.
Actual results: The encrypted password protected files can be reopened without password and edited.
Expected results: Password protected files should not open without the password.
Additional info: This is a security issue for the customer and hence high priority.
To be very clear, and looking at what I get here with this version, the documents are encrypted correctly and are only decrypted successfully if the correct password is given, right ?
But, if cancel is selected at the password dialog the import as a docx/pptx fails and the encrypted file is opened as raw text by some fall back logic. i.e. gibberish is shown. Which is the same thing as you would get if you e.g. opened the encrypted file in gedit as raw text.
So, assuming I'm looking at the right problem, this is unsightly and we should just fail to open it, but its not a security issue because there is no data theft possibility. Such raw encrypted data can be opened and edited in any text editor.
caolanm->mstahl: this happens in 5.0 but not in 5.1, can you track down the commit which make it behave as expected
this is fixed upstream in 5.2.0 by
Author: Maxim Monastirsky <email@example.com>
AuthorDate: Wed Apr 27 16:19:13 2016 +0300
tdf#80999 Canceling password prompt should abort detection
... instead of continuing the detection loop and being
"detected" as plain text. The detection API will from now
return a type based on the file extension only, which is
far more useful than "plain text" anyway. Plus the media
descriptor has a flag to indicate that the detection wasn't
completed, which can be also used by the loading code to
abort the loading process.
patch applies cleanly to libreoffice-5-0 my branch and passes "make check".
Verified with RHEL-7.4-20170330.1 and libreoffice-126.96.36.199-7
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.