-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
pranitaurlam/musicblocks
#3Description
Description
The Express server in index.js (line 33) uses express.static(path.join(__dirname)) which serves the entire project root directory as static files.
This exposes sensitive files to anyone who can access the server, including:
package.json/package-lock.json(dependency versions → known CVEs)dockerfile(infrastructure details).gitmodules,.npmrc(internal config)index.js(the server source code itself)jest.config.js,eslint.config.mjs(build/test config)
Steps to Reproduce
- Run
node index.js - Open
http://localhost:3000/package.jsonin browser - The full
package.jsonis visible
Expected Behavior
Only public-facing assets (index.html, css/, js/, lib/, images/, etc.) should be served. Server configuration and build files should not be accessible.
Proposed Fix
Restrict express.static() to serve only the necessary public directories, or add explicit deny rules for sensitive files.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels