Skip to content

fix: harden path handling, validate HTTP methods, tighten default perms#3

Open
victalejo wants to merge 1 commit into
swiftwave-org:mainfrom
victalejo:main
Open

fix: harden path handling, validate HTTP methods, tighten default perms#3
victalejo wants to merge 1 commit into
swiftwave-org:mainfrom
victalejo:main

Conversation

@victalejo

Copy link
Copy Markdown

Summary

  • Reemplaza exec.Command("rm", "-rf", pvDirectory+"/*") por borrado nativo en Go (os.ReadDir + os.RemoveAll con filepath.Join). Además de eliminar la concatenación insegura de paths, corrige un bug latente: exec.Command no pasa por shell, así que el * nunca se expandía y rm intentaba borrar un archivo llamado literalmente *.
  • Valida el método HTTP contra un whitelist (GET/POST/PUT/DELETE/PATCH/HEAD/OPTIONS) antes de pasarlo a curl -X en RestoreFromURL y BackupToURL. Antes se aceptaba cualquier string del flag --http-method.
  • Baja permisos por defecto de directorios creados de 0777 a 0755 en cli.go (init de /app y mkdir del file-op).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant