Skip to content

Performance: CSV import loads entire file into memory with no size limit #40

@philipithomas

Description

@philipithomas

Description

In app/models/subscribers_import.rb:14-25, CSV.parse(f.read, headers: false) loads the entire CSV file into memory with no file size validation.

Risk

A large CSV upload could exhaust server memory (DoS).

Recommendation

  • Validate file size before processing (e.g., max 5MB)
  • Use streaming CSV parsing (CSV.foreach) instead of loading all at once

Severity

Medium

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