Skip to content
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

Is it possible to enforce sanitization for all title attributes using #h or #html_safe? #1741

Open
ndbroadbent opened this issue Nov 18, 2022 · 1 comment

Comments

@ndbroadbent
Copy link

I have a few tooltips that need to use HTML tags, so I use Bootstrap tooltips with the html: true option: https://getbootstrap.com/docs/4.3/components/tooltips/#options

I've run into a few XSS issues where I've forgotten to escape the title attributes in my Rails views.

Is there a way I can configure brakeman to make sure I'm properly sanitizing every title attribute in my views? Or is it possible to write my own custom check class?

I'm starting to wonder if the html: true option is just too dangerous, but I do need the HTML support in my tooltips.

@presidentbeef
Copy link
Owner

Hi @ndbroadbent can you give an example of what the code looks like?

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

2 participants