You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
event-import: cap the decoded record size before readline buffers it #1255
From the 2026-11-01 scan: F-037 (low, denial of service, CWE-409), src/services/event-import-service.ts. Reachability was not established by the scan.
Current code (main 49f51378): readJsonlCandidatesFromStream() passes its input straight to readline.createInterface({ crlfDelay: Infinity, input }). readline accumulates a whole record before yielding it, so a decompressed payload with no newline grows until memory or string limits abort the import. The decoder is created by the caller, so the open stream carries no record-size bound.
Fix shape
Insert a streaming transform that counts decoded bytes since the last newline and errors past a configurable per-record limit.
On overflow, destroy the source and the decompressor together, and fail with a typed error naming the limit and the record number.
Consider a total decoded-byte budget for the import as a second control.
Acceptance
A compressed input whose single record decodes past the limit aborts with the typed error, and RSS stays flat while it happens.
A normal large file with many small records still imports unchanged.
Shipped in PR #1276, merged as a70871f49be6cbb19bf1db3fd1fd719657486875 on rewrite/main (2026-11-29T12:33Z). Closes is inert because the base is not the repository's default branch, so this closes by hand.
Activity
chore(changeset): add changeset for #1255
fix(event-import): cap decoded record size before readline buffers (#…
chappie-daemon commentedon Nov 29, 2026
Shipped in PR #1276, merged as
a70871f49be6cbb19bf1db3fd1fd719657486875onrewrite/main(2026-11-29T12:33Z).Closesis inert because the base is not the repository's default branch, so this closes by hand.