Skip to content

Instantly share code, notes, and snippets.

@mattetti
Last active December 10, 2015 15:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattetti/4455907 to your computer and use it in GitHub Desktop.
Save mattetti/4455907 to your computer and use it in GitHub Desktop.
Disable YAML parsing in ActiveSupport's XmlMini to avoid a Rails exploit via a XML payload containing YAML type nodes. I don't know of any apps needing to embed YAML in a XML and getting Rails to auto parse the payload so I think this is a pretty safe patch.
ActiveSupport::XmlMini::FORMATTING.update("yaml" => Proc.new{|yaml| yaml.to_s })
ActiveSupport::XmlMini::PARSING.update("yaml" => Proc.new{|yaml| yaml.to_s })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment