From a33f0f85047834212ff4baf5b479c6cf3d2a6075 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Sun, 13 Feb 2011 08:02:34 +0530 Subject: [PATCH] security fix for optional ADC (admin-defined command) feature Thanks to Dylan Simon for catching it... --- src/gitolite.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gitolite.pm b/src/gitolite.pm index 7861203..acc6d67 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -1058,6 +1058,7 @@ sub shell_out { sub try_adc { my ($cmd, @args) = split ' ', $ENV{SSH_ORIGINAL_COMMAND}; if (-x "$GL_ADC_PATH/$cmd") { + die "I don't like $cmd\n" if $cmd =~ /\.\./; # yes this is rather strict, sorry. do { die "I don't like $_\n" unless $_ =~ $ADC_CMD_ARGS_PATT } for ($cmd, @args); log_it("$GL_ADC_PATH/$ENV{SSH_ORIGINAL_COMMAND}");