From 2514cb058c0c07eecc56f1d7e1b11f23cae8c3fd Mon Sep 17 00:00:00 2001 From: Souradip Ghosh Date: Wed, 10 Sep 2025 16:08:45 +0530 Subject: [PATCH] feat: introduce vulnerable sample --- main.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 025b035..a644725 100644 --- a/main.go +++ b/main.go @@ -1 +1,15 @@ -package main; func main(){} +package main +import ( + "crypto/md5" + "fmt" + "io/ioutil" + "net/http" +) +func main() { + http.HandleFunc("/read", func(w http.ResponseWriter, r *http.Request) { + file := r.URL.Query().Get("file") + b, _ := ioutil.ReadFile("./data/" + file) + fmt.Fprintf(w, "%x", md5.Sum(b)) + }) + http.ListenAndServe(":8080", nil) +}