All the code paths that serialize an attachment content through XAROutputFilterStream are affected: the page recycle bin (with the default file store and with the hibernate store), the attachment recycle bin when it uses the hibernate content store (xwiki.store.attachment.recyclebin.content.hint=hibernate, HibernateDeletedAttachmentContent), the XAR export, and XWikiDocument#toXML / XWikiAttachment#toXML with the attachment content. Deleted attachments are not affected with the default file attachment recycle bin content store, which copies the content to the end of the stream.
Only attachments whose content stream returns a short read are truncated: in practice the attachments larger than a few KB stored in the S3 blob store (the 4096-byte attachments of the test were intact).
The fix cannot repair what was already written: recycle bin entries created before the fix keep their truncated attachments (the attachment content of a deleted page is removed with the page), so restoring such an entry after upgrading still gives truncated attachments.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.