parse-community / parse-community/parse-server
Add Global Clickjacking Protection Headers to ParseServer.app
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
New Feature / Enhancement Checklist
- Report security issues confidentially. This is not a security vulnerability report.
- Any contribution is under the project license.
- Before posting, I searched existing issues and found no duplicates.
Current Limitation
Parse Server does not automatically apply clickjacking protection headers on several routes such as /health, static file routes, or other Public API endpoints.
While the PagesRouter is capable of setting headers like X-Frame-Options and Content-Security-Policy: frame-ancestors,
there is no equivalent global protection applied within the broader ParseServer.app request pipeline.
This results in the following limitations:
- Endpoints like
/parse/healthcan be freely embedded inside external<iframe>elements. - Security behavior is inconsistent between PagesRouter and the rest of ParseServer.app.
- Developers have no unified way to manage or customize security headers across all responses.
Feature / Enhancement Description
A feature is needed to enable global clickjacking protection headers across the entire ParseServer.app layer.
Examples of relevant headers:
X-Frame-Options: DENY | SAMEORIGINContent-Security-Policy: frame-ancestors 'none' | 'self'
To support this, I propose introducing a global configuration that applies security headers consistently across all Parse Server routes.
One possible implementation approach:
security: {
secureHeaders: true, // Enable default clickjacking protection headers
customHeaders: { // Allow overrides as needed
"X-Frame-Options": "SAMEORIGIN",
"Content-Security-Policy": "frame-ancestors 'self'"
}
}
Another viable approach is extending the existing pages options to expose similar functionality in a unified way:
pages: {
enableRouter: true,
secureHeaders: true,
customHeaders: {}
}
I can implement this feature and submit a PR based on whichever design direction best aligns with the project’s architecture.
Desired outcome:
- Apply clickjacking protection headers globally within
ParseServer.app - Ensure consistent security behavior across PagesRouter and all other endpoints
- Allow developers to easily customize security headers per deployment needs
- Preserve full backward compatibility while improving default security
Example Use Case
- Install and configure Parse Server normally
- Load the
/parse/healthendpoint inside an external<iframe> - Currently, the iframe renders the endpoint without restriction
- When
secureHeadersis enabled:- All responses from ParseServer.app automatically include
X-Frame-OptionsandCSP frame-ancestors - External iframe embedding is blocked
- All responses from ParseServer.app automatically include
- Custom policies can be applied to allow only specific admin domains if needed
Alternatives / Workarounds
Before implementing this feature, Parse Server did not provide any built-in way to apply clickjacking-related security headers globally. Developers had to rely on one of the following workarounds, each with limitations:
- PagesRouter secure headers
- Only apply to PagesRouter responses
- Not applied to other endpoints such as
/health, file routes, or Public API routes
- Adding a custom Express middleware externally
- Possible, but breaks consistency with Parse Server’s configuration structure
- Security behavior becomes fragmented between Parse Server internals and user-defined middleware
With the proposed enhancement (global secureHeaders + customHeaders options), these limitations are removed.
Developers can now configure security headers directly through Parse Server’s built-in options without patching or overriding internal behavior.
3rd Party References
Many web frameworks provide global security header functionality by default:
- Express Helmet (
helmet.frameguard,helmet.contentSecurityPolicy) - Django: built-in
X-Frame-Optionsmiddleware - Rails:
config.action_dispatch.default_headers
To align with common security practice (e.g., OWASP Clickjacking Defense),
Parse Server would benefit from offering global clickjacking protection configuration.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ParseServer.app request pipeline and the existing PagesRouter security-header handling described in the issue. Decide how the global and custom header configuration should fit the existing options, then verify consistent headers on /health, static file routes, Public API endpoints, and PagesRouter responses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- express, javascript, nodejs
- Domain
- api, backend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100