mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-06 13:18:30 +02:00
v3.1.1 init
- Fixed path traverse bug in web server file manager - Merged docker container list from main - Updated version code - Merged network status fix from PR - Removed unused comments in dpcore -
This commit is contained in:
@@ -42,6 +42,10 @@ func (fm *FileManager) HandleList(w http.ResponseWriter, r *http.Request) {
|
||||
// Construct the absolute path to the target directory
|
||||
targetDir := filepath.Join(fm.Directory, directory)
|
||||
|
||||
// Clean path to prevent path escape #274
|
||||
targetDir = filepath.ToSlash(filepath.Clean(targetDir))
|
||||
targetDir = strings.ReplaceAll(targetDir, "../", "")
|
||||
|
||||
// Open the target directory
|
||||
dirEntries, err := os.ReadDir(targetDir)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user