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: collect deletion targets in one pass instead of copying the array per tag #1254
From the 2026-11-01 scan: F-020 (low, denial of service, CWE-407), src/services/event-import-service.ts. Reachability was not established by the scan.
Current code (main 49f51378): the deletion-target collector builds its list by spreading the accumulator for every matching tag — tags.reduce((ids, tag) => <is e-tag> ? [...ids, tag[1]] : ids, []). Each spread copies the whole array, so a signed kind-5 with N references performs O(N²) work before any referenced event is looked up, blocking the import process.
Fix shape
Accumulate into one array (or a Set for deduplication) in a single loop.
Enforce a documented per-event deletion-target limit before database processing, and chunk large lookups.
Acceptance
A kind-5 with 50k e tags completes in linear time.
Duplicate ids collapse to one target, and a request over the documented limit is rejected with a named error.
Fix is up on my fork: saket0187#1 (commit 55ada70). Deletion ids are now collected in one loop, and the importer refuses a kind-5 naming more than 65,533 ids instead of crashing the whole import. Please review, and if possible cherry-pick it.
Activity
saket0187 commentedon Nov 27, 2026
@cameri @chappie-daemon Hi, I'd like to work on this. Could you assign it to me?
saket0187 commentedon Nov 27, 2026
Fix is up on my fork: saket0187#1 (commit 55ada70). Deletion ids are now collected in one loop, and the importer refuses a kind-5 naming more than 65,533 ids instead of crashing the whole import. Please review, and if possible cherry-pick it.
cameri commentedon Nov 27, 2026
@saket0187 Assigned to you
fix(import): collect the ids of a deletion request in one loop and ca…