Cap pasted statement text size before regex parsing #8

Open
opened 2026-06-06 19:58:11 +00:00 by tonym · 0 comments

Severity: medium
Category: security
Location: app.py:1757-1922

Problem

/debts/add-from-statement and /debts/parse-statement accept unbounded free text and run regex on it — a megabyte paste is a CPU-DoS vector.

Suggested fix

Truncate text to e.g. 100KB before processing (MAX_CONTENT_LENGTH also helps).

Filed by automated code review.

**Severity:** medium **Category:** security **Location:** `app.py:1757-1922` ### Problem `/debts/add-from-statement` and `/debts/parse-statement` accept unbounded free text and run regex on it — a megabyte paste is a CPU-DoS vector. ### Suggested fix Truncate `text` to e.g. 100KB before processing (MAX_CONTENT_LENGTH also helps). _Filed by automated code review._
tonym added the
security
severity:medium
labels 2026-06-06 19:58:11 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bonna61/Moon-Household-Budget#8
No description provided.