

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Managing Secrets
incomplete
2: Injecting Secrets at Runtime
incomplete
3: Protecting Secrets
incomplete
4: Build Artifacts and Deployment Hygiene
incomplete
5: Limiting Build Context
incomplete
6: Source Code and Config Leaks
incomplete
7: Public File Leaks
incomplete
8: Server-Side Request Forgery
incomplete
9: Defending Against SSRF
incomplete
10: Open Redirects
incomplete
11: Risks of Dependencies
incomplete
12: Auditing Dependencies
incomplete
13: Dependency Maintenance
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
A web server can expose source code and configuration simply because its static-file boundary is too broad. Imagine you have a podcast app and want to serve some static images:
app.use(express.static("."));
Sure, this serves /public/logo.png, but it also serves /package.json and /src/integrations/ticketProvider.ts!
Express 5 ignores dotfiles like .git and .env by default, but the project root still exposes waaaay more than intended. Serve a deliberately curated directory instead:
app.use(express.static("public"));