[GH-ISSUE #5937] The client tag parser has the same polynomial-regex shape the server-side one just fixed #3283

Closed
opened 2026-10-21 06:01:40 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Sep 7, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5937

Originally assigned to: @SpicyMarinara on GitHub.

While closing a CodeQL polynomial-regex finding in the shared skill-check tag parser,
the verification pass measured the sibling parser one file over and found the same
class: parseTagAttributes in packages/client/src/lib/game-tag-parser.ts (~line
129) takes ~7.9 seconds on a tag body of 60,000 repeated zeros, growing
quadratically. It is pre-existing on staging, client-side, and was not what CodeQL
flagged — but it parses the same model-authored tag bodies, so the same adversarial
shape reaches it.

The exposure is bounded (the input is the model's own generated text, and the parse
runs on the client), so this is a hardening follow-up rather than an urgent hole. The
smallest honest fix is the same shape that closed the server-side finding: replace
the ambiguous repetition with a linear scan or a possessive-style pattern, and pin it
with the same many-zeros timing case, sized around 24k zeros where the
quadratic/linear separation is unambiguous at a fraction of the cost.

Originally created by @kolacheee on GitHub (Sep 7, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5937 Originally assigned to: @SpicyMarinara on GitHub. While closing a CodeQL polynomial-regex finding in the shared skill-check tag parser, the verification pass measured the sibling parser one file over and found the same class: `parseTagAttributes` in `packages/client/src/lib/game-tag-parser.ts` (~line 129) takes ~7.9 seconds on a tag body of 60,000 repeated zeros, growing quadratically. It is pre-existing on staging, client-side, and was not what CodeQL flagged — but it parses the same model-authored tag bodies, so the same adversarial shape reaches it. The exposure is bounded (the input is the model's own generated text, and the parse runs on the client), so this is a hardening follow-up rather than an urgent hole. The smallest honest fix is the same shape that closed the server-side finding: replace the ambiguous repetition with a linear scan or a possessive-style pattern, and pin it with the same many-zeros timing case, sized around 24k zeros where the quadratic/linear separation is unambiguous at a fraction of the cost.
bsakaguchi 2026-10-21 06:01:40 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 8, 2026):

@SpicyMarinara (Codex) is handling this issue in the maintainer-requested Issue Sweep PR #5962. Existing implementation PRs, draft PRs and issue-linked branches were checked before starting. The fix will reuse existing code and include focused regression proof; this comment records ownership, not completion.

<!-- gh-comment-id:5585131835 --> @SpicyMarinara commented on GitHub (Sep 8, 2026): @SpicyMarinara (Codex) is handling this issue in the maintainer-requested Issue Sweep PR #5962. Existing implementation PRs, draft PRs and issue-linked branches were checked before starting. The fix will reuse existing code and include focused regression proof; this comment records ownership, not completion.
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#3283
No description provided.