diff options
| author | hukl <contact@smyck.org> | 2009-10-17 13:56:01 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-10-17 13:56:01 +0200 |
| commit | c36132551b62e7d249948712d6dc47be614c28a5 (patch) | |
| tree | 03d259bc98c11defc0ab36e961f1d95d335833e4 /config | |
| parent | b7c233271b072ba408bfa9e9e8cc6fde7726c558 (diff) | |
added sanitize statements to hopefully all critical templates to protect against cross site scripting.
added section to environment.rb listing the whitelisted tags and attributes and examples on how to extend the list
Diffstat (limited to 'config')
| -rw-r--r-- | config/environment.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/config/environment.rb b/config/environment.rb index bff2a70..18415aa 100644 --- a/config/environment.rb +++ b/config/environment.rb | |||
| @@ -30,9 +30,19 @@ Rails::Initializer.run do |config| | |||
| 30 | # :all can be used as a placeholder for all plugins not explicitly named | 30 | # :all can be used as a placeholder for all plugins not explicitly named |
| 31 | # config.plugins = [ :exception_notification, :ssl_requirement, :all ] | 31 | # config.plugins = [ :exception_notification, :ssl_requirement, :all ] |
| 32 | 32 | ||
| 33 | # Skip frameworks you're not going to use. To use Rails without a database, | 33 | # Allowed Tags |
| 34 | # you must remove the Active Record framework. | 34 | # strong em b i p code pre tt samp kbd var sub sup dfn cite big small |
| 35 | # config.frameworks -= [ :active_record, :active_resource, :action_mailer ] | 35 | # address hr br div span h1 h2 h3 h4 h5 h6 ul ol li dt dd abbr |
| 36 | # acronym a img blockquote del ins | ||
| 37 | |||
| 38 | # Allowed Attributes: | ||
| 39 | # href src width height alt cite datetime title class name xml:lang abbr)) | ||
| 40 | |||
| 41 | # Add tags to whitelist with: | ||
| 42 | # config.action_view.sanitized_allowed_tags = 'table', 'tr', 'td' | ||
| 43 | |||
| 44 | # Add attributes to whitelist with: | ||
| 45 | # config.action_view.sanitized_allowed_attributes = 'id', 'class', 'style' | ||
| 36 | 46 | ||
| 37 | # Activate observers that should always be running | 47 | # Activate observers that should always be running |
| 38 | # config.active_record.observers = :cacher, :garbage_collector, :forum_observer | 48 | # config.active_record.observers = :cacher, :garbage_collector, :forum_observer |
