HIGH: Template rendering bypass in HandleAppCreate/HandleAppUpdate can produce partial HTML #121
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
merge-ready
merge-ready
needs-checks
needs-checks
needs-rebase
needs-rebase
needs-review
needs-review
needs-rework
needs-rework
notplanned
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/upaas#121
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
Several error paths in
HandleAppCreateandHandleAppUpdatecalltmpl.ExecuteTemplate(writer, ...)directly instead of usingh.renderTemplate(writer, tmpl, ...). TherenderTemplatemethod renders into a buffer first and only writes to the ResponseWriter on success, preventing partial/corrupt HTML. The direct calls bypass this safety.Affected Code
internal/handlers/app.go—HandleAppCreate:internal/handlers/app.go—HandleAppUpdate:Other error paths in the same functions correctly use
h.renderTemplate.Impact
If template execution fails partway through (e.g., missing template data), a partial HTML response is sent to the browser. This is unlikely in practice but violates the safety invariant that
renderTemplatewas specifically designed to enforce.Fix
Replace all
tmpl.ExecuteTemplate(writer, ...)calls withh.renderTemplate(writer, tmpl, ...).