mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
fix(security): potential vulnerability of path traversal attacks EE-5303 (#8728)
This commit is contained in:
parent
1a451823d9
commit
30a2bb0495
3 changed files with 7 additions and 3 deletions
|
@ -15,6 +15,10 @@ func UserIsAdminOrEndpointAdmin(user *portainer.User, endpointID portainer.Endpo
|
|||
}
|
||||
|
||||
// GetStackFilePaths returns a list of file paths based on stack project path
|
||||
// If absolute is false, the path sanitization step will be skipped, which makes the returning
|
||||
// paths vulnerable to path traversal attacks. Thus, the followed function using the returning
|
||||
// paths are responsible to sanitize the raw paths
|
||||
// If absolute is true, the raw paths will be sanitized
|
||||
func GetStackFilePaths(stack *portainer.Stack, absolute bool) []string {
|
||||
if !absolute {
|
||||
return append([]string{stack.EntryPoint}, stack.AdditionalFiles...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue