

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: Cross-Site Scripting (XSS)
incomplete
2: Fix Cross-Site Scripting
incomplete
3: Cross-Site Request Forgery (CSRF)
incomplete
4: CSRF Tokens
incomplete
5: Content Security Policy
incomplete
6: Legitimate Inline Scripts
incomplete
7: Sandboxing 'iframe' Elements
incomplete
8: Clickjacking
incomplete
9: Same-Origin and Referrer Policies
incomplete
10: Cross-Origin Resource Sharing
incomplete
11: Route-Scoped CORS
incomplete
12: Security Header Middleware
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Security headers let a server tell the browser which behavior to permit, but they're easy to configure inconsistently. Bearly Secure already has separate middleware for several policies. One focused middleware keeps the complete browser-security baseline together without adding a dependency just to set headers.
The existing CSP, nonce, framing, referrer, and nosniff policies need to remain intact. The consolidated middleware also adds narrow defaults:
Cross-Origin-Opener-Policy: same-origin isolates the top-level browsing context from cross-origin openers.Cross-Origin-Resource-Policy: same-origin prevents other origins from loading the application's resources by default.Origin-Agent-Cluster: ?1 requests origin-keyed browser isolation.A sandboxed iframe without allow-same-origin has an opaque origin. The global same-origin resource policy would therefore block the shipping widget's own stylesheet and script. Override it only on those two public assets.
Transport policy remains separate. A local HTTP app should not send Strict-Transport-Security or CSP's upgrade-insecure-requests directive.
Bearly Secure's browser policies are split across middleware. Consolidate them and add the remaining header baseline without changing existing behavior.
With Bearly Secure still running, run and submit the CLI tests from the project root.