Attachments

Security & Limits

Network and filesystem safeguards, MIME allow-lists, and configurable limits

Network Safety (SSRF)

  • 1
    Absolute HTTP(S) only

    Rejects non-HTTP schemes and relative URLs. Host must resolve and cannot be private/loopback/link‑local when strict.

  • 2
    Strict mode

    ATTACHMENTS_SSRF_STRICT=1 or config turns on strict blocking even during tests.

  • 3
    Redirect cap

    Follows up to max_redirects.

Filesystem Safety

  • 1
    CWD confinement

    Paths are resolved against the task CWD; attempts to escape (including via symlinks) are denied.

  • 2
    Regular files only

    Non‑regular files are rejected.

MIME Policies

Per‑type allow‑lists gate what content is accepted after detection from initial bytes. Empty lists fall back to type heuristics.

attachments:
  allowed_mime_types:
    image: ["image/*"]
    audio: ["audio/*"]
    video: ["video/*"]
    pdf:   ["application/pdf"]

Global Limits & Settings

SettingDescriptionEnv VarDefault
attachments.max_download_size_bytesCap per download and binary part sizeATTACHMENTS_MAX_DOWNLOAD_SIZE_BYTES10_000_000
attachments.download_timeoutTimeout for a single remote fetchATTACHMENTS_DOWNLOAD_TIMEOUT30s
attachments.max_redirectsMax HTTP redirects to followATTACHMENTS_MAX_REDIRECTS3
attachments.mime_head_max_bytesBytes used for MIME detectionATTACHMENTS_MIME_HEAD_MAX_BYTES512
attachments.text_part_max_bytesText bytes loaded from filesATTACHMENTS_TEXT_PART_MAX_BYTES5_242_880
attachments.pdf_extract_max_charsMax characters extracted from PDFsATTACHMENTS_PDF_EXTRACT_MAX_CHARS1_000_000
attachments.http_user_agentUser‑Agent header for downloadsATTACHMENTS_HTTP_USER_AGENTCompozy/1.0
attachments.allowed_mime_types.*Per‑type allow‑listsATTACHMENTS_ALLOWED_MIME_TYPES_*See above
attachments.ssrf_strictBlock local/loopback even in testsATTACHMENTS_SSRF_STRICTfalse