Missing Security Headers (ARCH9141)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key swift.security.missing-security-headers · Severity info · Category security · CWE CWE-693
Flags a Vapor configure(_:) that installs no security-headers middleware and names no security header.
Incorrect
Section titled “Incorrect”func configure(_ app: Application) throws { try routes(app)}Correct
Section titled “Correct”func configure(_ app: Application) throws { app.middleware.use(SecurityHeadersMiddleware()) try routes(app)}Add a middleware that sets Strict-Transport-Security, Content-Security-Policy and X-Content-Type-Options: nosniff on every response.