Skip to content

[Security] Add rate limiting for export operations to prevent browser abuse #145

@magic-peach

Description

@magic-peach

Overview

While unlikely, a malicious actor or buggy UI could trigger many rapid exports, exhausting browser memory. Add a basic client-side rate limit on export operations.

Proposed Solution

Track time of last export and prevent starting a new one within 2 seconds:

const lastExportRef = useRef<number>(0)
const handleExport = () => {
  if (Date.now() - lastExportRef.current < 2000) return
  lastExportRef.current = Date.now()
  // proceed with export
}

Acceptance Criteria

  • Cannot start export within 2s of previous
  • No visible UI change (just silent prevention)
  • Rate limit resets after successful export

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions