修复:在0.1.6之前,libyaml容易受到恶意YAML有效载荷的堆溢出漏洞利用

添加vcr gem之后运行rspec时,会出现以下错误.简单运行gem安装psych – –enable-bundled-libyaml建议不能解决问题.我使用的是rbenv和 ruby-build,而我使用的是ruby 2.1.1.我要做什么来解决这个问题?
SafeYAML Warning
  ----------------

  You appear to have an outdated version of libyaml (0.1.4) installed on your system.

  Prior to 0.1.6,libyaml is vulnerable to a heap overflow exploit from malicIoUs YAML payloads.

  For more info,see:
  https://www.ruby-lang.org/en/news/2014/03/29/heap-overflow-in-yaml-uri-escape-parsing-cve-2014-2525/

  The easiest thing to do right Now is probably to update Psych to the latest version and enable
  the 'bundled-libyaml' option,which will install a vendored libyaml with the vulnerability patched:

  gem install psych -- --enable-bundled-libyaml

解决方法

首先,您必须更新ruby-build,他们最近修补了这个安全问题.现在,它安装libyaml 0.1.6来编译Ruby.
$rm -rf ~/.rbenv/plugins/ruby-build
$git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

重新编译,重新安装您使用的Ruby版本,2.0.0-p451在我的情况下:

$rbenv install 2.0.0-p451
rbenv: /home/ubuntu/.rbenv/versions/2.0.0-p451 already exists
continue with installation? (y/N) y
Downloading yaml-0.1.6.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/5fe00cda18ca5daeb43762b80c38e06e
...

它在我的情况下工作.

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...