Static asset with active session detected.
- Source: static_asset_with_session.yml
Static assets are often cached by services in front of the application (eg. CDNs). Serving static assets with sessions enabled may lead to Cross-Site Request Forgery (CSRF) attacks that can hijack a user's session.
✅ Ensure static resources are handled prior to session initialization:
// static middleware should be added before session middleware
app.use(express.static(__dirname + "/public"))
OWASP Top 10
To skip this rule during a scan, use the following flag
To run only this rule during a scan, use the following flag
Ready to take the next step? Learn more about Bearer Cloud.