/
avoid-content-tag.yaml
31 lines (31 loc) · 1.17 KB
/
avoid-content-tag.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
rules:
- id: avoid-content-tag
metadata:
source-rule-url: https://github.com/presidentbeef/brakeman/blob/main/lib/brakeman/checks/check_content_tag.rb
owasp:
- A07:2017 - Cross-Site Scripting (XSS)
- A03:2021 - Injection
cwe:
- "CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')"
references:
- https://github.com/presidentbeef/brakeman/blob/main/docs/warning_types/template_injection/index.markdown
- https://www.netsparker.com/blog/web-security/preventing-xss-ruby-on-rails-web-applications/
category: security
technology:
- rails
cwe2022-top25: true
cwe2021-top25: true
subcategory:
- audit
likelihood: LOW
impact: MEDIUM
confidence: LOW
message: >-
'content_tag()' bypasses HTML escaping for some portion of the content.
If external data can reach here, this exposes your application
to cross-site scripting (XSS) attacks. Ensure no external data reaches here.
If you must do this, create your HTML manually and use 'html_safe'. Ensure no
external data enters the HTML-safe string!
languages: [ruby]
severity: WARNING
pattern: content_tag(...)