-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[security] Config.read: Use YAML.safe_load to avoid arbitrary Ruby class instantiation #334
Conversation
…ass instantiation Previously used YAML.load designed for deserialization from trusted sources only, allowing `!ruby/object:AnyClass ...` and other risky constructs. The risk depends on ruby classes available in the application; sometimes a class may have side effects - up to arbitrary code execution - when instantiated and/or built up with `x[key] = value` during YAML parsing. Despite this fix, using untrusted config is still a questionable idea!
lib/kubeclient/version.rb
Outdated
@@ -1,4 +1,4 @@ | |||
# Kubernetes REST-API Client | |||
module Kubeclient | |||
VERSION = '3.1.0'.freeze | |||
VERSION = '3.1.1'.freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump should happen on master
CHANGELOG.md
Outdated
@@ -4,6 +4,15 @@ Notable changes to this project will be documented in this file. | |||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). | |||
Kubeclient release versioning follows [SemVer](https://semver.org/). | |||
|
|||
## 3.1.1 - 2018-05-31 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should say ## Next
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, took out bump, changed this to "Unreleased"
👍 ... I guess version bumping is fine if this get's merged and released as it is ... but in general prefer not bumping in a PR |
… class instantiation Same as ManageIQ/kubeclient#334.
… class instantiation (#295) Same as ManageIQ/kubeclient#334.
Promised in README since 040d6ea (ManageIQ#334). Didn't work - absolute path lookups were allowed! Test passed because some of the paths were still relative.
Promised in README since 040d6ea (ManageIQ#334). Didn't work - absolute path lookups were allowed! Test passed because some of the paths were still relative.
Previously used YAML.load designed for deserialization from trusted sources only, allowing
!ruby/object:AnyClass ...
and other risky constructs.The risk depends on ruby classes available in the application; sometimes a class may have side effects - up to arbitrary code execution - when instantiated and/or built up with
x[key] = value
during YAML parsing.[See https://www.sitepoint.com/anatomy-of-an-exploit-an-in-depth-look-at-the-rails-yaml-vulnerability/ for one detailed example how
YAML.load
made Rails vulnerable, and ruby/psych#119 for more links]Documented
Config.read
andConfig.new
better.Documented when config may read other files from file system.
☹️ , fixed in Really enforce Config.new(data, nil) prevents external file lookups #372.
Added tests forUPDATE: no it didn't prevent thisConfig.new(data, nil)
preventing this (this happens via TypeError, might improve to nicer exception but out of scope here).Added warning that despite this fix, using untrusted config remains a questionable idea!
@moolitayer @grosser @pkliczewski @masayag please review.
@moolitayer, I want to release this quickly, possibly by myself.
(Hence CHANGELOG and version bump all in one PR.)