[GH-ISSUE #8885] [Issue]: open code scanning alerts on staging before v2.5.2 #8541

Closed
opened 2026-11-07 16:43:38 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @SpicyMarinara on GitHub (Nov 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8885

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Code scanning reports six open alerts on staging, and they'd carry into main with the v2.5.2 promotion (#8878):

  • #680, #712, #713: file paths built from a stored or request id without the containment check the sibling routes use.
  • #714, #715: two text-cleanup patterns whose cost grows with the square of a long run of separators.
  • #681: a route without its own rate limit.

Expected behavior

Every path that's built from an id is checked to stay inside its folder, the same way its sibling routes check theirs. Text cleanup takes time proportional to the input's length.

Actual behavior

  • ensureCharacterGalleryDir joins the stored character id without isUnsafePathSegment or assertInsideDir, unlike ensurePersonaGalleryDir. Profile import and Mari can store any id.
  • The sprite rename route relies only on its zod check, while the sprite upload and delete routes use basename and assertInsideDir.
  • A 50,000-character sprite label or NovelAI prompt made of one long separator run takes about 1.5 s of event-loop time, measured on an Apple M4.

Steps to reproduce

  1. Open code scanning alerts #680, #681, #712, #713, #714 and #715 for refs/heads/staging.

Environment

  • Marinara Engine version: staging a6c316a2bc (2.5.2)
  • Install type: any
  • OS + version: any
  • Browser or app shell: n/a

Logs, screenshots, or video

See the code scanning alerts.

Additional context

Part of the v2.5.2 release (#8877). #681 is a false positive: the global rate-limit hook covers that route, as with #433 and #434. The fix PR links this issue.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Nov 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8885 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Code scanning reports six open alerts on staging, and they'd carry into main with the v2.5.2 promotion (#8878): - #680, #712, #713: file paths built from a stored or request id without the containment check the sibling routes use. - #714, #715: two text-cleanup patterns whose cost grows with the square of a long run of separators. - #681: a route without its own rate limit. ## Expected behavior Every path that's built from an id is checked to stay inside its folder, the same way its sibling routes check theirs. Text cleanup takes time proportional to the input's length. ## Actual behavior - `ensureCharacterGalleryDir` joins the stored character id without `isUnsafePathSegment` or `assertInsideDir`, unlike `ensurePersonaGalleryDir`. Profile import and Mari can store any id. - The sprite rename route relies only on its zod check, while the sprite upload and delete routes use `basename` and `assertInsideDir`. - A 50,000-character sprite label or NovelAI prompt made of one long separator run takes about 1.5 s of event-loop time, measured on an Apple M4. ## Steps to reproduce 1. Open code scanning alerts #680, #681, #712, #713, #714 and #715 for `refs/heads/staging`. ## Environment - Marinara Engine version: staging a6c316a2bc (2.5.2) - Install type: any - OS + version: any - Browser or app shell: n/a ## Logs, screenshots, or video See the code scanning alerts. ## Additional context Part of the v2.5.2 release (#8877). #681 is a false positive: the global rate-limit hook covers that route, as with #433 and #434. The fix PR links this issue. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-11-07 16:43:38 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8541
No description provided.