Skip to content

Document that neither Rego nor ClamAV enforces MIME/file-type rules inside ZIP archives #1190

Open

Description

@suse-coder

Summary

Docs should state that blocking file types in postprocessing does not apply to files inside archives.

  • Rego only evaluates the structured input the pipeline already provides (outer filename, extension, MIME, size, etc.). It does not unpack ZIP/TAR/7z/… or MIME-scan nested members.
  • ClamAV (if enabled) is an antivirus scanner. It may inspect archive members for malware signatures. It is not a MIME/file-type policy engine. A clean .exe inside a .zip is typically not blocked just because it is an executable.

So this is expected, not a Rego bug and not something ClamAV is meant to cover:

Upload Typical Rego MIME/extension rule Typical ClamAV (no malware hit)
malware.exe (outer EXE) denied depends on signature
clean.exe (outer EXE) denied allowed (not a virus)
archive.zip containing clean.exe allowed (application/zip) allowed (not a virus)
archive.zip containing known malware allowed by MIME policy denied only if ClamAV detects it

Nested file-type control (deny EXE/script/etc. inside ZIP) is not provided by Rego and not provided by ClamAV.

Why this is a docs gap

Operators write “deny .exe / application/x-msdownload” in Rego and assume EXEs cannot be uploaded. Archives bypass outer MIME/extension checks. Pointing people at ClamAV for that gap is also wrong: ClamAV does not implement “block this MIME inside the archive.”

Without this in the docs:

  • False sense of security (“we block executables”).
  • Support tickets against Rego (“ZIP with EXE gets through”).
  • Misconfiguration: enabling ClamAV and believing it is nested MIME policy.

What each layer actually does

Rego

  • Can: outer metadata already in input (name, extension, declared MIME, size, user, checksum, …).
  • Cannot: decompress archives, walk members, magic-byte/MIME inner files, recurse nested archives.

ClamAV

  • Can: signature-based malware detection; many builds also unpack common archives for that purpose.
  • Cannot (as used for this problem): “deny if any inner file is an EXE/script/…”; guaranteed listing of inner MIMEs into Rego; password-protected archives; unlimited nested/zip-bomb unpacking.

ClamAV ≠ archive MIME scanner ≠ file-type firewall.

Activity

  1. changed the title [-]Document that Rego postprocessing does not inspect archive contents (ZIP/EXE nested files); use ClamAV for that[/-] [+]Document that Rego postprocessing does not inspect archive contents (ZIP/EXE nested files)[/+] on Sep 29, 2026
  2. changed the title [-]Document that Rego postprocessing does not inspect archive contents (ZIP/EXE nested files)[/-] [+]Document that neither Rego nor ClamAV enforces MIME/file-type rules inside ZIP archives[/+] on Sep 29, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions