Skip to content

hardening(chat): user-reachable conversation uploads have no per-user quota and buffer the body before the size check #20217

Closed
2 of 2 issues completed

Description

@mrveiss

Problem

PR #20213 lets non-admin owners upload to their own conversation, which makes these reachable by ordinary users (from its review):

Acceptance criteria

Activity

  1. added
    bugSomething isn't working
    phase:M3.9Chat, Agents, Analytics and Settings screens
    on Oct 31, 2026
  2. mrveiss commented on Oct 31, 2026

    @mrveiss
    OwnerAuthor

    Checked on main 6b66650 (merge train PR #20245): not delivered. api/conversation_file_upload.py still does await file.read() before the MAX_FILE_SIZE check, and no per-user quota exists. All 3 criteria stay unticked.

  3. mrveiss commented on Nov 2, 2026

    @mrveiss
    OwnerAuthor

    Decision needed, raised by PR #20668: agent-created files are charged to the agent's name, so all users share one agent quota and one user's agent can lock out everyone else's. Options: (A) keep this; (B, recommended) add a quota_owner column set to the session owner, charge agent writes to it, and keep uploaded_by as provenance, which needs a column and a backfill proposed through the review queue (#17038); (C) exempt agent files and cap them per session, a second limit.

  4. added
    needs-decisionBlocked on an owner decision; options and a recommendation are on the issue
    and removed
    needs-decisionBlocked on an owner decision; options and a recommendation are on the issue
    on Nov 2, 2026
  5. mrveiss commented on Nov 2, 2026

    @mrveiss
    OwnerAuthor

    The agent-file quota question moved to #20678, so it survives this issue closing.

  6. added
    needs-ac-evidenceClosed by a merge keyword; awaits an AC evidence table comment (#19520)
    on Nov 3, 2026
  7. github-actions commented on Nov 3, 2026

    @github-actions
    Contributor

    Landed via the merge train (#20713, merge ae35848bb7) via #20668

  8. mrveiss commented on Nov 3, 2026

    @mrveiss
    OwnerAuthor

    Checked against main at merge ae35848 (the merge train, PR #20713; member #20668).

    AC Evidence
    The size limit is enforced while reading; oversize stops early, with a test DELIVERED. autobot-backend/api/conversation_file_upload.py _read_within reads in chunks and refuses past the limit; validate_and_read_upload_file uses it. Tests: api/conversation_files_upload_limits_20217_test.py::test_an_oversize_body_stops_the_read_early, conversation_file_size_cap_20217_test.py
    A per-user quota from configuration, clear error, test DELIVERED. autobot-backend/conversation_file_quota.py USER_QUOTA_BYTES from AUTOBOT_CONVERSATION_FILE_USER_QUOTA_BYTES (registered in autobot_shared/env_registry_knowledge.py), quota_refusal with code conversation_file_quota_exceeded. Tests: conversation_file_quota_store_20217_test.py::test_create_is_refused_past_the_quota_and_stores_nothing, conversation_files_upload_limits_20217_test.py::test_a_user_past_their_quota_is_refused_by_the_route_and_nothing_is_stored
    Owner deletion of own files recorded on #20195 as a maintainer decision DELIVERED. #20195 comment "Maintainer decisions 2026-10-31": owners may list, download, preview and delete their own conversation files; delete stays soft
  9. added and removed
    needs-ac-evidenceClosed by a merge keyword; awaits an AC evidence table comment (#19520)
    on Nov 3, 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

    backendbugSomething isn't workingphase:M3.9Chat, Agents, Analytics and Settings screens

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions