Skip to content

Commit

Permalink
Use YAML.safe_load when loading custom config
Browse files Browse the repository at this point in the history
There's a vulnerability in `YAML.load` which can enable arbitrary code to be run
on our sytems. `YAML.safe_load` does not deserialize unsafe classes.

Related reading:
http://blog.codeclimate.com/blog/2013/01/10/rails-remote-code-execution-vulnerability-explained/
ruby/psych#119
http://docs.ruby-lang.org/en/2.1.0/Psych.html#method-c-safe_load
  • Loading branch information
Greg Lazarev committed Feb 26, 2015
1 parent 331eecd commit 20cf002
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/repo_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def load_javascript_ignore
end

def parse_yaml(content)
YAML.load(content)
YAML.safe_load(content)
rescue Psych::SyntaxError
{}
end
Expand Down

0 comments on commit 20cf002

Please sign in to comment.