mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-09 22:52:58 +03:00
🚀 Feature: hardened CSP headers #58
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lordraiden on GitHub.
Feature Description
Add a new section to the Pocket-ID documentation that provides a recommended Content Security Policy (CSP) header configuration for the Pocket-ID login page. This policy will provide a layer of protection against client-side attacks like Cross-Site Scripting (XSS) and data injection. The documentation should explain each directive in the policy and how it contributes to security.
The documentation should recommend a basic, secure CSP header that can be easily implemented by users running Pocket-ID behind a reverse proxy. This is a common setup in homelabs.
### Pitch
This feature request is about defense in depth. While Pocket-ID's core functionality is secure, the login page itself is a potential attack vector. A well-defined CSP adds a critical layer of protection by instructing the user's browser to only load resources from trusted sources.
This is a low-effort, high-reward change. It doesn't require any changes to the Pocket-ID codebase itself. The recommended policy can be added to the documentation, allowing users to configure it on their own reverse proxy (like Nginx, Caddy, or Traefik). By following the example of projects like Authentik, Pocket-ID can provide its users with the tools they need to harden their own self-hosted environments.
@stonith404 commented on GitHub:
I believe it would be a good idea to add a default CSP header to Pocket ID. If users want to harden the header further by overriding it, they can do so on their reverse proxy. However, I don't think we need to document this, as a CSP header applies to all applications and is not specific to Pocket ID. Do you agree?