← Java / Spring · Contents

JAVA-056 / Intermediate

Exposed Git directory in static resources or configuration (.git)

A05:2021 Security Misconfiguration · CWE-538 Insertion of Sensitive Information into Externally-Accessible File

Why is this a problem?

Source and history can be reconstructed from /.git/config and similar files.

How to fix it

text
Deploy only the JAR, restrict static paths to src/main/resources/static, and block .git

Further reading