Skip to content

[BUG] Message export writes an unprotected archive when the password is blank #609

Backlog

Description

@tonygermano

A message export that asks for a password but gives a blank one (empty or only whitespace) writes a plain, unprotected archive and reports success.

Steps

  1. Call POST /channels/{channelId}/messages/_exportUsingFilter with archiveFormat=zip, passwordEnabled true, encryptionType=AES256 and password set to three spaces. The query-parameter variant with password=%20%20%20 ends up in the same place, since fix: Honor the password in the query-parameter message export #586 enables the password whenever it is not empty.
  2. Open the resulting archive.

Expected

The password is used, or the request is rejected with a message that the password is blank. Nothing unprotected is written.

Actual

A plain ZIP, HTTP 200, and no log entry. The password is enabled, but MessageWriterFactory and ArchiveUtils both skip it with StringUtils.isNotBlank.

The same is true for TAR, where the unsupported-format check from #580 also skips a blank password.

Existing behavior

The Administrator already refuses a blank password. MessageExportPanel shows "A password is required." when "Password Protect: Yes" is selected and the field is blank (isBlank). The server API has no such check, so a request that bypasses the GUI gets an unprotected archive.

This came up in the review of #586. It was left as is there because #586 did not change what happens to a blank password: the archive is the same whether the servlet enables the password or not.

Options

  1. Reject it. Fail up front in MessageWriterFactory with a message that the password is blank, and write nothing. This matches the GUI and the direction of [BUG] Query-parameter message export ignores the password and writes an unprotected ZIP #582 and [BUG] Message export fails with a NullPointerException when a password is given without an encryption type #591. It changes behavior for any client that currently sends a blank password with the password enabled and relies on getting a plain archive.
  2. Use it. A password of spaces is weak but valid, and a caller who asked for a password gets one. This means changing ArchiveUtils and the factory check, and it differs from the GUI.
  3. Keep ignoring it. No change, with the behavior documented. This leaves the same failure as [BUG] Query-parameter message export ignores the password and writes an unprotected ZIP #582 in place for blank passwords.

I'd lean toward rejecting it, but it needs a maintainer decision, since options 1 and 2 both change behavior.

Related

Claude checked: the blank-password path through MessageWriterFactory and ArchiveUtils for ZIP and TAR, and the GUI validation in MessageExportPanel, by reading the code. Claude did not run it against a server.


🤖 Drafted with Claude Code

Activity

  1. added
    bug
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions