You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Query-parameter message export ignores the password and writes an unprotected ZIP #582
The query-parameter variant of the server-side message export endpoint ignores the password parameter, so a request for a password-protected ZIP silently produces an unprotected one.
Steps
Call POST /channels/{channelId}/messages/_export with archiveFormat=zip, password=secret and encryptionType=AES256 as query parameters, and a rootFolder and archiveFileName the server can write to.
Open the resulting ZIP.
Expected
The archive is encrypted with the given password.
Actual
The export succeeds and the archive is not encrypted.
Cause
MessageServlet.getMessageWriterOptions copies password and encryptionType into the MessageWriterOptions, but never calls setPasswordEnabled. MessageWriterFactory only applies a password when isPasswordEnabled() is true, so it is dropped.
The other overload, which takes a MessageWriterOptions object in the request body, is not affected, because the options arrive with passwordEnabled as the client set it. The administrator's export dialog uses that overload.
Fix
Call writerOptions.setPasswordEnabled(StringUtils.isNotEmpty(password)) in getMessageWriterOptions.
Claude checked: reproduced on a server built from oie/main (dcd48b9, zip4j 1.3.3). A channel with two messages was exported with POST /api/channels/{channelId}/messages/_export?contentType=RAW&rootFolder=appdata/temp/verify-export&filePattern=${message.messageId}.txt&archiveFileName=query-export&archiveFormat=zip&password=secret&encryptionType=AES256&pageSize=10. The request returned 2 and wrote query-export.zip. Both entries have the encrypted flag clear and deflate compression, and the first entry reads back without a password.
Activity
Honor the password in the query-parameter message export
Honor the password in the query-parameter message export
Honor the password in the query-parameter message export