Skip to content

Feature: Check Mailer templates for html injection #1939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
NiklasHae opened this issue May 13, 2025 · 0 comments
Open

Feature: Check Mailer templates for html injection #1939

NiklasHae opened this issue May 13, 2025 · 0 comments

Comments

@NiklasHae
Copy link

Is your feature request related to a problem? Please describe.
Brakeman currently does not analyze HTML email templates for HTML injection vulnerabilities. As a result, potential security issues in mailer views may go undetected. I propose extending Brakeman’s coverage to include mailer templates, scanning them for common HTML injection issues.

Describe the solution you’d like
Brakeman should flag unsafe code patterns in mailer templates with appropriate warnings - similar to how it handles views rendered by ActionController. For example, the following should raise a warning when found in an email template:

<!-- insecure.html.erb -->
<p><%= raw @insecure_user_input %></p>

Describe alternatives you’ve considered
One workaround is to render HTML mailer templates through ActionController, allowing Brakeman to pick them up via its existing view analysis. However, this is more of a workaround than a long-term solution and may introduce unintended behavior.

Additional context
I'd be happy to help implement this feature if there’s broader interest in adding support for mailer template checks in Brakeman.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant