all repos — elgit @ 44e7c584adf41a335897f8a9a9722138a6f19670

fork of legit: web frontend for git, written in go

don't use user input for repository path access

Alan Pearce
commit

44e7c584adf41a335897f8a9a9722138a6f19670

parent

9c621945f4985e3fce4e12fc25e1d7898b117aa3

1 file changed, 0 insertions(+), 9 deletions(-)

changed files
M routes/util.goroutes/util.go
@@ -5,14 +5,12 @@ "bufio"
"fmt" "log" "os" - "path" "path/filepath" "slices" "strings" "alin.ovh/elgit/data" "alin.ovh/elgit/git" - securejoin "github.com/cyphar/filepath-securejoin" "github.com/microcosm-cc/bluemonday" "github.com/russross/blackfriday/v2" "github.com/savsgio/atreugo/v11"
@@ -46,13 +44,6 @@ }
func (d *deps) isNotAllowed(name string) bool { return d.repos.BySlug[name] == nil -} - -func (d *deps) GetCleanPath(name string) (string, error) { - return securejoin.SecureJoin( - filepath.Join(d.c.Repo.Root, "repositories"), - path.Clean(name)+".git", - ) } func ReadProjectsList(filename string) ([]string, error) {