Go

Go

Made by DeepSource

Audit required: Exposure of directory listing using net/http.FileServer GO-S1034

Security
Major
a01 owasp top 10 cwe-548

A directory listing is inappropriately exposed using net/http.FileServer, yielding potentially sensitive information to attackers.

Bad practice

package main

import (
    "net/http"
)

func main() {
    http.Handle("/", http.FileServer(http.Dir("/")))
    _ = http.ListenAndServe(":3000", nil)
}

References