fix(ui): encode every id in API paths (client-side path traversal)
Backend Image / build-and-push (push) Successful in 1m9s
Frontend Image / build-and-push (push) Successful in 2m2s

Follow-up to a7609ff for the whole frontend: all 30 API helpers in
src/lib now pass path values through encodeURIComponent, so an id taken
from the URL can never leave its own path segment and make the page call
another endpoint with the viewer's token.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Nick SzaunigandClaude Opus 5.5 committed 2026-10-06 06:40:25 +02:00
1 parent a7609ff3f8
commit fc887d8431
30 files changed
+90 -90

No files matched your search

+2 -2
View File
@@ -9,14 +9,14 @@ export function updateAutomationRule(
id: string,
input: UpdateAutomationRuleInput,
): Promise<AutomationRule> {
return apiFetch<AutomationRule>(`/automation-rules/${id}`, {
return apiFetch<AutomationRule>(`/automation-rules/${encodeURIComponent(id)}`, {
method: "PATCH",
body: JSON.stringify(input),
});
}
export function resetAutomationRuleSequence(id: string): Promise<AutomationRule> {
return apiFetch<AutomationRule>(`/automation-rules/${id}/reset-sequence`, {
return apiFetch<AutomationRule>(`/automation-rules/${encodeURIComponent(id)}/reset-sequence`, {
method: "POST",
});
}