Git repository metadata is publicly readable
GET https://www.acme-shop.example/.git/config
→ GET /.git/config HTTP/1.1 Host: www.acme-shop.example User-Agent: TrustpectScanner/1.0 (+https://trustpect.com/security) ← HTTP/1.1 200 OK Content-Type: text/plain [core] repositoryformatversion = 0 [remote "origin"] url = https://•••• masked@git.example/acme/shop.git ✓ confirmed · body matches git config signature
# /etc/nginx/sites-enabled/acme-shop.conf location ~ /\.(git|svn|hg) { deny all; return 404; }
# .htaccess or vhost RedirectMatch 404 /\.git <DirectoryMatch "/\.git"> Require all denied </DirectoryMatch>
# Security → WAF → Custom rule Expression: (http.request.uri.path contains "/.git") Action: Block
// before express.static(...) app.use(/\/\.git/, (req, res) => res.sendStatus(404));