diff --git a/backend/go-app/main.go b/backend/go-app/main.go index d1cab711..6df286b9 100755 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -4458,7 +4458,7 @@ func handleStopCloudSync(syncUrl string, org shuffle.Org) (*shuffle.Org, error) return &org, errors.New(fmt.Sprintf("Couldn't find any sync key to disable org %s", org.Id)) } - log.Printf("[INFO] Should run cloud sync disable for org %s with URL %s and sync key %s", org.Id, syncUrl, org.SyncConfig.Apikey) + log.Printf("[INFO] Should run cloud sync disable for org %s with URL %s", org.Id, syncUrl) client := shuffle.GetExternalClient(syncUrl) req, err := http.NewRequest( diff --git a/functions/onprem/orborus/orborus.go b/functions/onprem/orborus/orborus.go index d13acf89..18f3b9aa 100755 --- a/functions/onprem/orborus/orborus.go +++ b/functions/onprem/orborus/orborus.go @@ -986,8 +986,6 @@ func fixk8sRoles() { } } -func int32Ptr(i int32) *int32 { return &i } - func deployK8sWorker(image string, identifier string, env []string) error { env = append(env, fmt.Sprintf("IS_KUBERNETES=true")) env = append(env, fmt.Sprintf("KUBERNETES_NAMESPACE=%s", os.Getenv("KUBERNETES_NAMESPACE"))) @@ -1199,7 +1197,7 @@ func deployK8sWorker(image string, identifier string, env []string) error { Name: identifier, }, Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(replicaNumberInt32), + Replicas: &replicaNumberInt32, Selector: &metav1.LabelSelector{ MatchLabels: containerLabels, }, @@ -3338,6 +3336,11 @@ func extractZIP(zipFile, destDir string) error { } for _, f := range r.File { + // Fix path traversal + if strings.Contains(f.Name, "..") { + return fmt.Errorf("illegal file name: %s", f.Name) + } + err := extractFile(f, destDir) if err != nil { return err diff --git a/functions/onprem/worker/worker.go b/functions/onprem/worker/worker.go index 16e2b76e..12ff86c6 100644 --- a/functions/onprem/worker/worker.go +++ b/functions/onprem/worker/worker.go @@ -389,8 +389,6 @@ func shutdown(workflowExecution shuffle.WorkflowExecution, nodeId string, reason } } -func int32Ptr(i int32) *int32 { return &i } - // ** STARTREMOVE ***/ func deployk8sApp(image string, identifier string, env []string) error { if len(os.Getenv("KUBERNETES_NAMESPACE")) > 0 { @@ -569,7 +567,7 @@ func deployk8sApp(image string, identifier string, env []string) error { Name: podName, }, Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(replicaNumberInt32), + Replicas: &replicaNumberInt32, Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "app": podName, @@ -919,7 +917,7 @@ func deployApp(cli *dockerclient.Client, image string, identifier string, env [] Env: env, } - log.Printf("[DEBUG] Deploying image with env: %#v", env) + //log.Printf("[DEBUG] Deploying image with env: %#v", env) // Checking as late as possible, just in case. newExecId := fmt.Sprintf("%s_%s", workflowExecution.ExecutionId, action.ID)