Skip to content

memory-exhaustion: OpenSubtitles responses read unbounded into memory #524

Description

@forkwright

Finding

OpenSubtitlesProvider::search() (line 290) and download() (line 364) read the /subtitles and /download-link responses via reqwest's response.json().await with no size cap, buffering the full body into memory, while the sibling subtitle-content fetch a few lines below correctly routes through the byte-capped read_body_capped — so a large/malicious/MITM'd upstream response exhausts process memory on every subtitle search.

Evidence

crates/prostheke/src/providers/opensubtitles.rs:290,364. Surfaced by the 2026-07-03 deep-audit workflow (adversarially verified + Opus-judged).

Why this matters

Any subtitle search or download against a large, malicious, or MITM'd upstream response buffers the entire body into memory unbounded, risking OOM of the whole process from a single request.

Desired correction

Route both JSON reads through read_body_capped(max_body_bytes) (as the rest of prostheke/epignosis/komide do) and deserialize from the capped buffer instead of calling .json() directly.

Done when: the defect's failure mode no longer reproduces and a regression test covers it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions