fix: protect mail previews and attachments - #86
Merged
Conversation
Contributor
|
Wasn't this already fixed in #84 ? @markvaneijk |
Contributor
|
These are all good additions. Merging. Thanks @jeromecoloma |
Contributor
Author
|
Thanks! |
markvaneijk
added a commit
that referenced
this pull request
Aug 25, 2026
Port #86 into the monorepo copy of the package. - Require Filament authentication and the plugin's canManageMails() check on the preview and attachment routes - Scope attachment lookups to their parent mail so an attachment cannot be downloaded through an unrelated mail record - Return 404 responses for missing or mismatched records - Render stored email HTML in a sandboxed iframe and add security headers to direct preview responses - Register the routes as authenticated (tenant) panel routes Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
Released in v5.2.1 |
markvaneijk
added a commit
that referenced
this pull request
Aug 26, 2026
Port the remaining parts of #86 that 5.x did not pick up in #299. - Render stored email HTML in a sandboxed iframe via srcdoc instead of pointing the iframe at the preview route - Serve the preview with a sandboxing Content-Security-Policy plus Referrer-Policy and X-Frame-Options - Type the controller responses and read the mail model with Config::string() - Cover the new headers and the sandboxed render in the security test Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
canManageMails()permission checkSecurity impact
Previously, preview and attachment routes could expose stored email content without authentication. Attachment IDs were also resolved independently of the mail ID in the URL.
This change protects both routes and prevents attachments from being downloaded through unrelated mail records.
Testing
composer validate --strictpassedcomposer auditreported no known vulnerabilities