1
0

really-fix-directory-traversal.patch 569 B

12345678910111213141516
  1. Subject: Really fix directory traversal
  2. Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
  3. Forwarded: https://github.com/openfibernet/tftp-proxy/pull/3
  4. Date: 2024-02-08
  5. --- a/main.go
  6. +++ b/main.go
  7. @@ -18,7 +18,7 @@
  8. // readHandler is called when client starts file download from server
  9. func readHandler(filename string, rf io.ReaderFrom) error {
  10. - file_path := filepath.Clean(path.Join(dir, filename))
  11. + file_path := path.Join(dir, filepath.Clean(path.Join("/", filename)))
  12. if _, err := os.Stat(file_path); err == nil {
  13. file, err := os.Open(file_path)