SlideShare a Scribd company logo
Rails is Secure
 but YMMV
Franck Verrot, Lyon.rb, March 2012
Me!
• Franck Verrot
• http://twitter.com/cesariogw
• http://github.com/cesario

• Co-Founder of evome
• Currently awesoming at shazino
@hamakov
@hamakov

• Hacked GitHub
@hamakov

• Hacked GitHub
• Exploited bad architecture
@hamakov

• Hacked GitHub
• Exploited bad architecture
• Exploited current Rails worst practices
Software Architecture
         101
SOLID
           principles
• Single Responsibility
• Open/Close
• Liskov Substitution
• Interface Segregation
• Dependency Inversion
Current practices
What’s the problem?
         Rails + ActionPack
  1 class PostsController < ApplicationController
  2   respond_to :html, :json
  3   def index
  4     respond_with(@posts = Post.all)
  5   end
  6 end
What’s the problem?
         Rails + ActionPack
  1 class PostsController < ApplicationController
  2   respond_to :html, :json
  3   def index
  4     respond_with(@posts = Post.all)
  5   end
  6 end
Architecture at risk
     (scary title I know)
Issues

• Tight coupling: referencing a constant
• Hard to test: referencing a constant
• AR pattern FTL: DB table in a form!?
Refactor!
(Wrong) Solutions


• Think attr_accessible is the way to go
• config.active_record.whitelist_attributes = true
Rails is Secure
(Better) Solutions (YMMV)


• Ban “params”  (Rails #2510 “request.params”)



• Use an ActiveModel object for validating
  parameters
(Other) Solutions (WIP)


• https://github.com/technoweenie/
  tainted_hash

• https://github.com/rails/strong_parameters
Layered Architectures!
Thanks for listening!
       Q&A

More Related Content

KEY
MVC Gems
PDF
Java EE 7 meets Java 8
PDF
Can you TDD Rails?
PDF
Testing Alfresco extensions
KEY
Erlang - Dive Right In
PPTX
Rails automatic test driven development
PDF
Software Design Patterns in Laravel by Phill Sparks
PDF
Maven - Taming the Beast
MVC Gems
Java EE 7 meets Java 8
Can you TDD Rails?
Testing Alfresco extensions
Erlang - Dive Right In
Rails automatic test driven development
Software Design Patterns in Laravel by Phill Sparks
Maven - Taming the Beast

What's hot (20)

PDF
How I did create Telegram bot - Roman Senin
PDF
External Master Data in Alfresco: Integrating and Keeping Metadata Consistent...
PPTX
Saving Time By Testing With Jest
PPTX
Actors Set the Stage for Project Orleans
PDF
ELK Stack
PPTX
Test-Driven Sitecore
PDF
4Developers 2015: Lessons for Erlang VM - Michał Ślaski
PDF
Symfony Live San Francisco 2017 - Symfony @ OpenSky
PDF
Selenium Best Practices with Jason Huggins
PPTX
Austin Elixir: Slack Bots With Hedwig
PPTX
Releasing High Quality Packages - Longhorn PHP 2021
PDF
Symfony Live San Franciso 2017 - BDD API Development with Symfony and Behat
PDF
All Aboard for Laravel 5.1
PDF
PDF
Rethinking the debugger
PDF
10 Things you should know about Ruby
PDF
All the Laravel things: up and running to making $$
PPTX
Selenium
PDF
Legacy Sins
PPTX
Стероиды для Дотнетчика
How I did create Telegram bot - Roman Senin
External Master Data in Alfresco: Integrating and Keeping Metadata Consistent...
Saving Time By Testing With Jest
Actors Set the Stage for Project Orleans
ELK Stack
Test-Driven Sitecore
4Developers 2015: Lessons for Erlang VM - Michał Ślaski
Symfony Live San Francisco 2017 - Symfony @ OpenSky
Selenium Best Practices with Jason Huggins
Austin Elixir: Slack Bots With Hedwig
Releasing High Quality Packages - Longhorn PHP 2021
Symfony Live San Franciso 2017 - BDD API Development with Symfony and Behat
All Aboard for Laravel 5.1
Rethinking the debugger
10 Things you should know about Ruby
All the Laravel things: up and running to making $$
Selenium
Legacy Sins
Стероиды для Дотнетчика
Ad

Viewers also liked (19)

DOC
Sharanraj QA _ Resume
PPT
Ruby in the Clouds
PDF
Landry byers maria cannistra production manager
PDF
แนวข้อสอบวิศวโยธา กรุงเทพมหานคร (กทม)
PDF
PLoverview
PDF
Logos slideshow
DOCX
Marcy's cover letter
PPSX
20160108 mailchimp
DOCX
Alkes baru
PPTX
20151028 sociale media in de kinderopvang
DOC
marcy's resume
PPTX
Umrah presentation by Qasim Ali
PPTX
Banners Broker Panel Training
PDF
NEBOSH-Management of International Health and Safety
PPTX
Mining Scientific Diagrams for facts
PDF
IOSH CERTIFICATE
PPTX
Metaheuristics-based Optimal Reactive Power Management in Offshore Wind Farms...
PPTX
My personal approach to 21st century Leadership (DP)
PDF
Learning and Development in Organizations
Sharanraj QA _ Resume
Ruby in the Clouds
Landry byers maria cannistra production manager
แนวข้อสอบวิศวโยธา กรุงเทพมหานคร (กทม)
PLoverview
Logos slideshow
Marcy's cover letter
20160108 mailchimp
Alkes baru
20151028 sociale media in de kinderopvang
marcy's resume
Umrah presentation by Qasim Ali
Banners Broker Panel Training
NEBOSH-Management of International Health and Safety
Mining Scientific Diagrams for facts
IOSH CERTIFICATE
Metaheuristics-based Optimal Reactive Power Management in Offshore Wind Farms...
My personal approach to 21st century Leadership (DP)
Learning and Development in Organizations
Ad

Similar to Rails is Secure (20)

ZIP
Continuous Integration For Rails Project
PDF
Ractor's speed is not light-speed
PDF
Ruby on Rails : 簡介與入門
PDF
Different Ways of Integrating React into Rails - Pros and Cons
PDF
Different ways of integrating React into Rails - Mikhail Bortnyk
PPTX
GitHub Actions Security - DDOG
PDF
Brief Introduction to Concurrent Programming
KEY
Enterprise search in Plone using Solr
PDF
Zend Framework 2, What's new, Confoo 2011
PDF
遇見 Ruby on Rails
KEY
Actors and Threads
PDF
2016-05-12 DCRUG React.rb
PDF
Upgrading to rails3
PDF
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
KEY
Polyglot Grails
PDF
pull requests I sent to scala/scala (ny-scala 2019)
PDF
Vue.js + Vuexチーム開発実践の事例
PDF
CSS 201
PPT
Clojure's take on concurrency
KEY
Rails traps
Continuous Integration For Rails Project
Ractor's speed is not light-speed
Ruby on Rails : 簡介與入門
Different Ways of Integrating React into Rails - Pros and Cons
Different ways of integrating React into Rails - Mikhail Bortnyk
GitHub Actions Security - DDOG
Brief Introduction to Concurrent Programming
Enterprise search in Plone using Solr
Zend Framework 2, What's new, Confoo 2011
遇見 Ruby on Rails
Actors and Threads
2016-05-12 DCRUG React.rb
Upgrading to rails3
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Polyglot Grails
pull requests I sent to scala/scala (ny-scala 2019)
Vue.js + Vuexチーム開発実践の事例
CSS 201
Clojure's take on concurrency
Rails traps

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
MYSQL Presentation for SQL database connectivity
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Cloud computing and distributed systems.
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Electronic commerce courselecture one. Pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Empathic Computing: Creating Shared Understanding
PDF
Chapter 3 Spatial Domain Image Processing.pdf
Approach and Philosophy of On baking technology
Reach Out and Touch Someone: Haptics and Empathic Computing
MYSQL Presentation for SQL database connectivity
The AUB Centre for AI in Media Proposal.docx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Cloud computing and distributed systems.
Digital-Transformation-Roadmap-for-Companies.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Encapsulation theory and applications.pdf
Unlocking AI with Model Context Protocol (MCP)
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectroscopy.pptx food analysis technology
Electronic commerce courselecture one. Pdf
MIND Revenue Release Quarter 2 2025 Press Release
Empathic Computing: Creating Shared Understanding
Chapter 3 Spatial Domain Image Processing.pdf

Rails is Secure

Editor's Notes