Issue 125954 - Sending document as Email removes invisible content - this should be a configuration option
Summary: Sending document as Email removes invisible content - this should be a config...
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: configuration (show other issues)
Version: 4.1.1
Hardware: All All
: P3 Normal with 2 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: needmoreinfo
Depends on:
Blocks:
 
Reported: 2014-12-18 12:18 UTC by Denis Simonet
Modified: 2016-05-02 01:08 UTC (History)
7 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Proposal for the new option (46.94 KB, image/png)
2014-12-18 12:18 UTC, Denis Simonet
no flags Details
Example document (8.74 KB, application/vnd.oasis.opendocument.text)
2014-12-23 08:02 UTC, Denis Simonet
no flags Details
Checkbox for setting the remove content option (13.41 KB, patch)
2015-03-02 12:34 UTC, Stefan Heinemann
no flags Details | Diff
Sample odt file with hidden text before it was attached to the email (18.39 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-04-23 04:03 UTC, Marilyn
no flags Details
Sample odt file with deleted hidden text after the email attachment was opened (17.92 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-04-23 04:05 UTC, Marilyn
no flags Details
Format of Sections in HiddenSectionSendMailBug ODT (50.49 KB, image/png)
2016-04-28 21:38 UTC, orcmid
no flags Details
Demonstration that Word 2016 will not hide ODT hidden sections (27.31 KB, image/png)
2016-04-28 22:26 UTC, orcmid
no flags Details
Confirmation that Hidden Section Removed (44.52 KB, image/png)
2016-04-28 22:36 UTC, orcmid
no flags Details
Digitally-Signed ODT with a Hidden Section (12.86 KB, application/vnd.oasis.opendocument.text)
2016-05-01 23:43 UTC, orcmid
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Denis Simonet 2014-12-18 12:18:02 UTC
Created attachment 84303 [details]
Proposal for the new option

When sending a document by eMail, OpenOffice intentionally removes any invisible content. While this can be appropriate for some users, others will not expect this to happen. In fact, there are situations where removing invisible content (such as hidden sections) damages the document. Therefore we suggest to introduce a new option which makes it possible to control this behaviour.

It is about the following code: main/sw/source/ui/app/docsh2.cxx +1175 (Call to mpDoc->RemoveInvisibleContent())
Comment 1 Kay 2014-12-22 22:21:16 UTC
A question about this. Does this happen when there IS hidden content?
Comment 2 Denis Simonet 2014-12-23 08:02:50 UTC
Created attachment 84309 [details]
Example document

I forgot to add the example document. It contains three sections, one of them being hidden (section 2). If you send this document by E-Mail, the attached document in the e-Mail won't contain section 2 anymore.
Comment 3 Denis Simonet 2014-12-23 08:05:35 UTC
Kay, there are no conditions - OpenOffice always removes invisible content before attaching the document to a new eMail. See the attached document.
Comment 4 sandra.ilcus@altom.ro 2015-01-24 18:53:59 UTC
In order to see that I understood what the report is about, I’ve replicated the bug described by the initial reporter (Denis Simonet).

Configurations:

- Operating System: Windows 7 Professional x64
- Program/component name: OpenOffice Writer 4.1.0 and 4.1.1
- Release number for 4.1.0: Milestone AOO410m18 | Build ID 9764 | SVN r1589052
- Release number for 4.1.1: Milestone AOO411m6 | Build ID 9775 | SVN r1617669

Problem description:
The text that was marked as hidden in the OpenOffice Writer is removed when the document is uploaded and sent as an attachment via email.

Steps to reproduce:
1. Create or open an .odt file in OpenOffice Writer
2. Input content like text, paragraphs, tables in the document
3. Click Insert > Fields > Other >Select the Functions tab > Select ‘Hidden text’
4. Type the text that you want to hide in the Hidden text box
5. Click Insert and Close
6. Save the document as an .odt file
7. Attach the saved document to an email > Send the email to your own address
8. After receiving the email, open the attachment and look for the hidden text  

Actual result: The text hidden in OpenOffice Writer is removed, when the file is sent via email as an attachment.

 
Follow-up Tests:
Additionally, I did some research regarding the problem with the current design and initial reporter’s proposed design, because my initial intention is to advocate the proposed design.
 
This is what I did:

- I’ve checked on different versions of OpenOffice --> This design bug is applicable to 4.1.1 version of OpenOffice, but also to older ones, like 4.1.0, or 4.0.1.

- I’ve found out there are several ways of hiding text in OpenOffice Writer: https://wiki.openoffice.org/wiki/Documentation/OOoAuthors_User_Manual/Writer_Guide/Developing_conditional_content --> Applying any of them, I’ve noticed that the content is still removed when sending the document via email.

- I’ve checked what happens when saving the file as a PDF --> Same behavior: the hidden text from the .odt file is removed, when the file is saved as a PDF.

- I’ve compared the current design with competing products, like Microsoft Word --> Hiding text in a Word document and sending it via email, also removes the hidden text. So, a competing product like Microsoft Word also doesn’t offer the option to remove or leave the hidden text in a document sent via email. 

- I've searched the Bugzilla database for other similar bugs (Unconfirmed, Confirmed, Accepted) that might have been reported, related to hidden content. There are many results for the term 'hidden': 
https://issues.apache.org/ooo/buglist.cgi?bug_status=UNCONFIRMED&bug_status=CONFIRMED&bug_status=ACCEPTED&list_id=164456&product=Writer&query_format=advanced&resolution=---&short_desc=hidden&short_desc_type=allwordssubstr --> I couldn't find any bugs in which the reporters were complaining about the fact that the hidden text is not displayed when sending the document via email. Moreover, there were bugs where the complain was about the fact that the hidden sections/fields/text are visible when exported, for example, to PDF (https://issues.apache.org/ooo/show_bug.cgi?id=114633), as HTML    (https://issues.apache.org/ooo/show_bug.cgi?id=45969). 

- Since the initial reporter mentioned that “there are situations where removing invisible content (such as hidden sections) damages the document”, I’ve searched in the Bugzilla database for such situations --> Unfortunately, I didn’t find any clear and powerful situations to enhance the reporter’s statement and proposal. 


Conclusion after my follow-up tests: 
Since I didn’t find any relevant information (i.e. user complains about the current design, example of situations when removing hidden content damages the document, concurrent products that have already implemented the proposed design) I can’t rely on for advocating the proposed design, I decide to agree with the current (original) design.
Comment 5 dyo 2015-01-29 10:36:45 UTC
I don't agree with the conclusion that Sandra Ilcus make because:

1. We are an important administration with 400 users on Oracle OpenOffice 3.3. We extensively use OOOMacros to hide and unhidde sections during the life time of the documents we produce and it is always possible that a user decide to send a document at any time either directly from OpenOffice or with a Mail client program (for ex: Thunderbird). With Oracle OpenOffice this work fine (Hidden section stay hidden section in both situation) and the document received is the same. Now we want to migrate to Apache OpenOffice 4.1 but we hesitate because of this problem.

2. It seems that Microsoft Word delete the hidden sections too (I don't test because we use open source software), so it's not a reason to make the same (wrong?) choice or it's a chance to make a better products. What about the compatibility with Oracle OpenOffice 3.3 and previous version.

3. The comparaison with PDF Export as nothing to do, a PDF is more like a print of a document that represent only what is visible on the screen. I don't even know if hidden parts can exist in a PDF document. So in that case it's normal that hidden part don't becomes visible in a PDF.

4. I think the solution with a checkbox option (with defaut "Delete hidden section: YES) is the good one for all with respect of the choice made by Apache somewhere between version 3.3 and 3.4.
Comment 6 Denis Simonet 2015-01-29 12:41:35 UTC
Thank you for the detailed tests.

Maybe the reason for the lack of reports for this issue is the existance of an easy workaround: Just don't use this feature and manually write an email with attachment. While this might be a good solution for private users, especially governments cannot live with the risk that an employees use this feature which has such an unexpected side-effect. Official documents might be generated faulty.

You might also want to consider the fact that a feature is useless if people don't use it because they suspect it to jeopardize the integrity of the document.

Our intention is to do exactly what we requested: Add a configuration option so the user can decide whether OpenOffice shall remove invisible content before attaching the document to the email.

If we implement this feature for our customer and provide a patch, are you willing to include it in future releases of OpenOffice?
Comment 7 Stefan Heinemann 2015-03-02 12:34:09 UTC
Created attachment 84564 [details]
Checkbox for setting the remove content option

Patch for the implementation of a checkbox that let's the user choose whether the hidden content is removed when sending the document via email
Comment 8 Marilyn 2016-04-23 03:02:12 UTC
Using windows 7, I was able to replicate the removal of the invisible text issue, except my result showed a blank second row (Invisible text removed) instead of row 2 being completely gone after the email attachment was sent and opened.
I have documented the steps that I have performed below:
1)	Install Open Office 4.1.1. 
2)	Configure the Invisible Text: 
        a. Click on the Open Office icon to bring up the application.
        b. Click on Tools>Options>Office Writer>Formatting Aids:
        c. Verify that the following check boxes are selected: Hidden text,     Fields: Hidden text, and Fields: Hidden paragraph 
iv.	Click OK button to save the selections.
3)	Create a file containing an invisible text in Open Office Writer:
i.	Click on File>New>Text Document to bring up Open Office Writer: 
ii.	Click on Table>Insert>Table and create a table with 1 Colum and 3 Rows: in row 1 - type ‘Section 1’, in row 2 - leave this blank for now, and in row 3 – type ‘Section 3’
iii.	Position the cursor in row 2.
4)	Insert a ‘Hidden text’ in row 2:
i.	Click on Insert>Fields>Other>Functions:
ii.	Select ‘Hidden text’ under the Type section.
iii.	Type the text ‘Section 2’ (hidden or invisible) in the ‘Hidden text’ field under the Condition section.
iv.	Click on Insert and Close buttons to save the input.
5)	Go back to the document in Open Office Writer:
Verify that the text ‘Section 2’ that was typed in the ‘Hidden text’ field is displayed and grayed out in row 2.
6)	Save the file: 
i.	Click on File>Save As and use the file extension of ‘.odt’.
ii.	Use the default File Type ‘ODF Text Document ‘ODF Spreadsheet(.odt)’
7)	Send an email containing the file that was created above:
i.	Click on File>Send>’Document as Email’ to bring up the email client on the machine (Example: Outlook, Mozilla Thunderbird). The file should be displayed in the attachment section of the email being sent.
ii.	Send the email (containing the above file) to the chosen email destination.
8)	Verify the attached file containing the hidden (invisible) text:
i.	Open the email using an email application (Example: Outlook, Mozilla Thunderbird).
ii.	Click on the attachment to verify that the hidden text in row 2 has been removed.
I have also successfully replicated this issue in Open Office 4.1.1 using Windows 2010.
‘Hidden text’ (Invisible text) can be useful, for example, you may want to attach and send a file to someone and hide some sensitive characters or words and only show some text. Making the ‘hidden text’ an option gives the user a choice of whether he wants his recipient see the invisible text instead of being removed by default.
I have also found that a similar bug, 124799 - Particular document looses Style "First page" for page 1 with 'File-> Send -> "Document as E-Mail".  Comment 8 from mroe  – he can confirm the issue in Linux and that when he selected “Send’, he was able to see that the hidden  paragraphs are being selected and deleted.
Comment 9 Marilyn 2016-04-23 03:19:25 UTC
Using windows 7, I was able to replicate the removal of the invisible text issue, except my result showed a blank second row (Invisible text removed) instead of row 2 being completely gone after the email attachment was sent and opened.
I have documented the steps that I have performed below:
1)Install Open Office 4.1.1. 
2)Configure the Invisible Text: 
   a)Click on the Open Office icon to bring up the application.
   b)Click on Tools>Options>Office Writer>Formatting Aids:
   c)Verify that the following check boxes are selected: Hidden text, Fields:   Hidden text, and Fields: Hidden paragraph 
   d)Click OK button to save the selections.
3)Create a file containing an invisible text in Open Office Writer:
   a)Click on File>New>Text Document to bring up Open Office Writer: 
   b)Click on Table>Insert>Table and create a table with 1 Colum and 3 Rows: in row 1 - type ‘Section 1’, in row 2 - leave this blank for now, and in row 3 – type ‘Section 3’
   c)Position the cursor in row 2.
4)Insert a ‘Hidden text’ in row 2:
   a)Click on Insert>Fields>Other>Functions:
   b)Select ‘Hidden text’ under the Type section.
   c)Type the text ‘Section 2’ (hidden or invisible) in the ‘Hidden text’ field under the Condition section.
   d)Click on Insert and Close buttons to save the input.
5)Go back to the document in Open Office Writer:
   -Verify that the text ‘Section 2’ that was typed in the ‘Hidden text’ field is displayed and grayed out in row 2.
6)Save the file: 
   a)Click on File>Save As and use the file extension of ‘.odt’.
   b)Use the default File Type ‘ODF Text Document ‘ODF Spreadsheet(.odt)’
7)Send an email containing the file that was created above:
   a)Click on File>Send>’Document as Email’ to bring up the email client on the machine (Example: Outlook, Mozilla Thunderbird). The file should be displayed in the attachment section of the email being sent.
   b)Send the email (containing the above file) to the chosen email destination.
8)Verify the attached file containing the hidden (invisible) text:
   a)Open the email using an email application (Example: Outlook, Mozilla Thunderbird).
   b)Click on the attachment and you will notice that the hidden text in row 2 has been removed.
I have also successfully replicated this issue in Open Office 4.1.1 using Windows 2010.
I have also found that a similar bug, 124799 - Particular document looses Style "First page" for page 1 with 'File-> Send -> "Document as E-Mail".  Comment 8 from mroe  – he can confirm the issue in Linux and that when he selected “Send’, he was able to see that the hidden  paragraphs are being selected and deleted.
‘Hidden text’ (Invisible text) can be useful, for example, you may want to attach and send a file to someone and hide some sensitive characters or words and only show some text. Making the ‘hidden text’ an option gives the user a choice of whether he wants his recipient see the invisible text instead of being removed by default.
Comment 10 Marilyn 2016-04-23 04:03:18 UTC
Created attachment 85482 [details]
Sample odt file with hidden text before it was attached to the email
Comment 11 Marilyn 2016-04-23 04:05:50 UTC
Created attachment 85483 [details]
Sample odt file with deleted hidden text after the email attachment was opened
Comment 12 Kay 2016-04-25 21:25:09 UTC
(In reply to Stefan Heinemann from comment #7)
> Created attachment 84564 [details]
> Checkbox for setting the remove content option
> 
> Patch for the implementation of a checkbox that let's the user choose
> whether the hidden content is removed when sending the document via email

Thanks for the patch. Given the nature of this issue, I think it deserves some additional discussion, so I will post a message to "dev" shortly.

Personally, I am a little confused why content that was specifically designated as "hidden" should be "unhidden" when sending the document as e-mail.

More to come on this, I'm sure.
Comment 13 Stefan Heinemann 2016-04-26 07:16:28 UTC
> Personally, I am a little confused why content that was specifically designated > as "hidden" should be "unhidden" when sending the document as e-mail.

Not unhidden. The default behaviour is this that hidden content is _removed_ from the document, so once the doc is sent via E-Mail there's no way for the receiver to restore / unhide the hidden content.
Comment 14 Oliver Brinzing 2016-04-26 16:12:27 UTC
.
Comment 15 Kay 2016-04-28 15:42:10 UTC
(In reply to Stefan Heinemann from comment #13)
> > Personally, I am a little confused why content that was specifically designated > as "hidden" should be "unhidden" when sending the document as e-mail.
> 
> Not unhidden. The default behaviour is this that hidden content is _removed_
> from the document, so once the doc is sent via E-Mail there's no way for the
> receiver to restore / unhide the hidden content.

Thanks for the clarification, Stefan.

We are having a discussion about this issue (although rather late considering your efforts), on "dev" currently

http://markmail.org/message/z4bqggzrsv53ve2t

if you or anyone else who commented on this issue would like to take part.

Thanks again for your patch on this issue.
Comment 16 orcmid 2016-04-28 16:20:13 UTC
(In reply to Marilyn from comment #11)
> Created attachment 85483 [details]
> Sample odt file with deleted hidden text after the email attachment was
> opened

I am baffled about something.  These two issue attachments are identified as .docx documents, not .odt documents.  

I think we need to verify reproducibility with sending .odt documents to a recipient that has OpenOffice installed.  Otherwise, we are getting confused about conversion cases between OpenOffice and Microsoft Office.

(I will look at these attachments to see what they really are, also.)
Comment 17 orcmid 2016-04-28 16:33:11 UTC
(In reply to orcmid from comment #16)
> (In reply to Marilyn from comment #11)
> > Created attachment 85483 [details]
> > Sample odt file with deleted hidden text after the email attachment was
> > opened
[ ... ]
> (I will look at these attachments to see what they really are, also.)

Yes, the two attachments are truly .docx files.

They apparently include screen shots of .odt files.  That does not allow us to analyze the .odt to see what is actually happening.  We need the actual files, not screen shots.  

Also, providing screen shots inside Microsoft Word documents limits analysis of the issue to contributors who have Microsoft Office installed.  That's not a good expectation considering that our focus is on OpenOffice and its "native" formats here.  (I install and use all of the products in order to analyze interoperability, including with Office 365.  That's an exceptional case.)

For screen captures, it is better to use PNG files, which anyone who is doing QA can presumably open and use.  (JPEG files are often too blurry to be helpful.)  In this case, though, it is the actual ODT files that matter, since we can only see how "hidden" is being handled that way.
Comment 18 orcmid 2016-04-28 21:23:47 UTC
(In reply to sandra.ilcus@altom.ro from comment #4)
> In order to see that I understood what the report is about, I’ve replicated
> the bug described by the initial reporter (Denis Simonet).
[ ... ]
> 6. Save the document as an .odt file
> 7. Attach the saved document to an email > Send the email to your own address
> 8. After receiving the email, open the attachment and look for the hidden
> text  
> 
> Actual result: The text hidden in OpenOffice Writer is removed, when the
> file is sent via email as an attachment.
[ ... ]

I am having trouble with this test case.  If it is the saved document (not the document opened in Apache OpenOffice), then it is not Apache OpenOffice that is touching the document as it is being sent as an email attachment.

Should step (7) be reworded to have the saved document opened in Apache OpenOffice and sent via File > Send > Document as email ... ?
Comment 19 orcmid 2016-04-28 21:38:37 UTC
Created attachment 85505 [details]
Format of Sections in HiddenSectionSendMailBug ODT

This screen capture shows the presence of a hidden section in Attachment 84309 [details]
and how it can be found and hidden or unhidden by any user of Apache OpenOffice, OpenOffice.org, and LibreOffice.

Note that the demonstration case is specifically with a hidden section.
Comment 20 orcmid 2016-04-28 22:26:37 UTC
Created attachment 85512 [details]
Demonstration that Word 2016 will not hide ODT hidden sections

The Attachment 84309 [details] Hidden sections are not hidden when the ODT document is opened directly in Word 2016.  This is demonstration that some applications do not recognize hidden sections in ODF documents.  

While not directly tied to the original issue statements, it is confirmation that hiding is not a fool-proof privacy mechanism.  That needs to be taken into consideration when appraising an use case that hidden content is meant to support.
Comment 21 orcmid 2016-04-28 22:36:24 UTC
Created attachment 85513 [details]
Confirmation that Hidden Section Removed

Because of Issue 121427, I could not demonstrate the Send Document as E-mail ... action using Apache OpenOffice 4.1.2 on Windows 10.  However, I was able to send the document via LibreOffice 5.0.0 on the same system.  

After saving the e-mail-received document to disk and opening it in Apache OpenOffice, the hidden section is seen to be removed.
Comment 22 orcmid 2016-04-28 22:47:05 UTC
ANALYSIS

 1. It is confirmed that hidden sections are removed from documents send directly from Apache OpenOffice *and* LibreOffice.

 2. It is also confirmed that hidden section are not very secret, and that some applications reveal them automatically.  That is true for the Microsoft Office Word 2016 handling of ODT files.  (WordPad, on the other hand, does not show the hidden section [;<).

OBSERVATIONS

 1. The removal of hidden information is intended to accomplish two things: inadvertent disclosure and also protection of recipients from certain document-security vulnerabilities involving covert content and silently mining content on an user's computer.

 2. The removal of hidden information when "Send Document as E-mail ..." is used is appropriate default behavior that protects casual users.  It is also important that the behavior with Apache OpenOffice and LibreOffice are the same.

 3. That does not mean there could not be an option to retain hidden content, although that involves expert users able to understand the implications and to accomplish their purposes despite the use of hidden sections not being designed as a privacy mechanism.  The current default should be preserved.
Comment 23 orcmid 2016-04-28 22:52:26 UTC
(In reply to orcmid from comment #22)
A couple of corrections.

>  1. The removal of hidden information is intended to accomplish two things:
> *prevention*of* inadvertent disclosure [...]
> 
>  2. The removal of hidden information when "Send Document as E-mail ..." is
> used is appropriate default behavior that protects casual users.  It is also
> important that the behavior with Apache OpenOffice and LibreOffice are the
> same.

Note that stripping of hidden content also protects an user who inadvertently forwards a document containing hidden content unknown to them.
Comment 24 orcmid 2016-05-01 23:37:07 UTC
Here's an edge case that came up.

Digital Signatures are always applied to saved documents (i.e., they must be writable).  

However, when a document is opened in OpenOffice and Send > Document as E-mail ... is selected, the opened form of the document is rewritten to make the attachment with no hidden content.  The transmitted document will not have the signature because it has been altered.

I can't tell what AOO does in this case: refuse to send, state the problem, or send it silently with no signature.  I can't check this because AOO doesn't find my Email client because of Issue 121427.  CAN SOMEONE TEST THIS CASE.

However, Apache OpenOffice 4.1.2 will digitally sign a document with hidden sections.
 
LibreOffice 5.0.0 will not recognize the signature when the document has hidden sections, proclaiming that there is a defect of some sort.  LibreOffice 5.0.0 will also not sign such a document, although no reason is given.  The signing just doesn't happen and the document is not marked as signed.  

If I unhide the section, both will sign it and both will verify the signature.
Comment 25 orcmid 2016-05-01 23:43:40 UTC
Created attachment 85517 [details]
Digitally-Signed ODT with a Hidden Section

(In reply to orcmid from comment #24)
> Here's an edge case that came up.
> I can't tell what AOO does in this case: refuse to send, state the problem,
> or send it silently with no signature.  I can't check this because AOO
> doesn't find my Email client because of Issue 121427.  CAN SOMEONE TEST THIS
> CASE.
The attached ODT has a hidden section and is digitally-signed.  If you open this document in Apache OpenOffice you should see that it is signed (there will be a small indicator in the status line at the bottom of the Writer window).

If you do nothing but open the document in AOO, Do a Send > Document as E-mail ... and see whether there is any indication of a signature on the received document.  

 1. Is there any warning or message when you ask to do the send?
 2. If you email it to yourself, is it received and is it shown as signed at all?
Comment 26 orcmid 2016-05-02 01:08:50 UTC
(In reply to orcmid from comment #22)
>  1. It is confirmed that hidden sections are removed from documents send
> directly from Apache OpenOffice *and* LibreOffice.

Since Windows 8, it appears that latest releases of Apache OpenOffice are unable to find a default email client to even have File > Send > Document as E-mail properly.

In that case, and on all versions of Windows whether the direct sending works or not, there is a workaround.

 1. Save the document with hidden sections to a file if it is not in a file already.

 2.In the Windows File explorer, find the entry for the file in the folder where you have it.  

 3. Right click on the entry for the file to obtain the context menu.  

 4. Click "Send To >" (or whatever variation your OS uses)

 5. Select "Mail recipient" in the list that appears.  (Wording may vary on different versions of Windows).

If there is a default e-mail client, this will open an email with the file already set as an attachment.  Edit the email and send it.