[#65451] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
ko1@atdot.net wrote:
Eric Wong <normalperson@yhbt.net> wrote:
Eric Wong <normalperson@yhbt.net> wrote:
On 2014/10/09 11:04, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
[#65453] [ruby-trunk - Feature #10328] [PATCH] make OPT_SUPPORT_JOKE a proper VM option — ko1@...
Issue #10328 has been updated by Koichi Sasada.
[#65559] is there a name for this? — Xavier Noria <fxn@...>
When describing stuff about constants (working in their guide), you often
On 2014/10/09 20:41, Xavier Noria wrote:
On Thu, Oct 9, 2014 at 1:59 PM, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
[#65566] [ruby-trunk - Feature #10351] [Open] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been reported by Shyouhei Urabe.
[#65741] Re: [ruby-cvs:55121] normal:r47971 (trunk): test/ruby/test_rubyoptions.rb: fix race — Nobuyoshi Nakada <nobu@...>
On 2014/10/16 10:10, normal@ruby-lang.org wrote:
Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
2014-10-16 12:48 GMT+09:00 Eric Wong <normalperson@yhbt.net>:
[#65753] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
[#65818] [ruby-trunk - Feature #10351] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been updated by Shyouhei Urabe.
[ruby-core:65818] [ruby-trunk - Feature #10351] [PATCH] prevent CVE-2014-6277
Issue #10351 has been updated by Shyouhei Urabe.
Jeremy Evans wrote:
> The costs of this proposed change are much higher than the benefits. This just makes interaction with the operating system in general more difficult. It is likely this patch introduces more vulnerabilities than it fixes, in addition to breaking things.
I'm not a fundamentalist here. If anyone could propose a moderate way to samitize malicious environment variables, that should be taken seriously.
After shellshock we have to realize that environment variables are not as safe as we thought them to be. I don't think it's a good thing to neglect this fact to blame bash only. I'm proposing what I can do.
----------------------------------------
Feature #10351: [PATCH] prevent CVE-2014-6277
https://bugs.ruby-lang.org/issues/10351#change-49556
* Author: Shyouhei Urabe
* Status: Feedback
* Priority: Normal
* Assignee:
* Category: core
* Target version: current: 2.2.0
----------------------------------------
~~~
From 4636ca0308f1933c9b191f36e808a8d3bcf5e88e Mon Sep 17 00:00:00 2001
From: "Urabe, Shyouhei" <shyouhei@ruby-lang.org>
Date: Wed, 8 Oct 2014 15:44:27 +0900
Subject: [PATCH] prevent CVE-2014-6277
ShellShock was about bash. I think ruby is torellant for that kind of
attack. However the concept was that environment variables can
potentially contain malicious data. To pass them to victim
subprocecsses can sometimes cause catastrophic situation, like
arbitrary code execution. Even though ruby itself is not affected, it
can be an accomplice in attacks by blindly passing through any
uncontrolled info through. Let's just change this, more secure by
default.
This patch does not add a new feature, nor delete anything. It just
changes the default behaviour when ruby spawns subprocesses.
Process.spawn('/usr/bin/printenv') # -> prints nothing
You can explicitly pass what you need:
Process.spawn({'FOO'=>'BAR'}, '/usr/bin/printenv')
Or if you are 128% sure what you are doing, can pass everything.
ENV['FOO'] = 'BAR'
Process.spawn('/usr/bin/printenv', unsetenv_others: false)
I don't intend to make things impossible; just give it a better
default. It doesn't ultimately solve everything but it should prevent
casual faults.
---
process.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/process.c b/process.c
index f9bc01c..395333d 100644
--- a/process.c
+++ b/process.c
@@ -2295,7 +2295,7 @@ rb_execarg_fixup(VALUE execarg_obj)
eargp->dup2_tmpbuf = tmpbuf;
}
- unsetenv_others = eargp->unsetenv_others_given && eargp->unsetenv_others_do;
+ unsetenv_others = !eargp->unsetenv_others_given || eargp->unsetenv_others_do;
envopts = eargp->env_modification;
if (unsetenv_others || envopts != Qfalse) {
VALUE envtbl, envp_str, envp_buf;
@@ -2936,7 +2936,7 @@ rb_execarg_run_options(const struct rb_execarg *eargp, struct rb_execarg *sargp,
#endif
#if !defined(HAVE_WORKING_FORK)
- if (eargp->unsetenv_others_given && eargp->unsetenv_others_do) {
+ if (!eargp->unsetenv_others_given || eargp->unsetenv_others_do) {
save_env(sargp);
rb_env_clear();
}
@@ -3998,8 +3998,8 @@ rb_f_system(int argc, VALUE *argv)
* [cmdname, argv0], arg1, ... : command name, argv[0] and zero or more arguments (no shell)
* options: hash
* clearing environment variables:
- * :unsetenv_others => true : clear environment variables except specified by env
- * :unsetenv_others => false : don't clear (default)
+ * :unsetenv_others => true : clear environment variables except specified by env (default)
+ * :unsetenv_others => false : don't clear
* process group:
* :pgroup => true or 0 : make a new process group
* :pgroup => pgid : join to specified process group
--
1.9.1
~~~
--
https://bugs.ruby-lang.org/