BUG: HandleVolumeAdd missing path validation — path traversal possible on volume creation #107
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#107
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?
Severity: HIGH
File & Line
internal/handlers/app.go:978-1005Description
HandleVolumeAddacceptshost_pathandcontainer_pathfrom the form and passes them directly to the database without callingvalidateVolumePaths(). The validation function exists and is correctly used inHandleVolumeEdit(app.go:1176), but was missed in the add handler.Without validation, relative paths, non-clean paths (containing
..), and empty paths can be stored and later passed to Docker as bind mount sources.Impact
A volume with a relative or traversal path (e.g.
../../etc) could be created and used in the next deploy, potentially mounting unintended host directories into the container.Suggested Fix
Add
validateVolumePaths(hostPath, containerPath)check inHandleVolumeAddbefore saving, same asHandleVolumeEdit.