aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSitaram Chamarty <sitaram@atc.tcs.com>2010-04-09 16:48:46 +0530
committerSitaram Chamarty <sitaram@atc.tcs.com>2010-04-09 16:48:46 +0530
commit5deffee3cff5f9a13c59b8c1e357c5a32487d1c3 (patch)
treea25f5ea763a6f0356875f3a7e67c18a1656397b7
parent4b7d144 should have touched this also (diff)
downloadgitolite-gentoo-5deffee3cff5f9a13c59b8c1e357c5a32487d1c3.tar.gz
gitolite-gentoo-5deffee3cff5f9a13c59b8c1e357c5a32487d1c3.tar.bz2
gitolite-gentoo-5deffee3cff5f9a13c59b8c1e357c5a32487d1c3.zip
security: gitolite admin can get shell access by using screwy pubkey name
example: keydir/sitaram@$(some-dangerous-command; echo hi).pub (still won't get the reward; that is only if a non-admin user gets privs!)
-rwxr-xr-xsrc/gl-compile-conf6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gl-compile-conf b/src/gl-compile-conf
index 575ee61..1fb942b 100755
--- a/src/gl-compile-conf
+++ b/src/gl-compile-conf
@@ -511,6 +511,12 @@ print $newkeys_fh "# gitolite start\n";
wrap_chdir($GL_KEYDIR);
for my $pubkey (glob("*"))
{
+ # security check (thanks to divVerent for catching this)
+ unless ($pubkey =~ $USERNAME_PATT) {
+ print STDERR "$pubkey contains some unsavoury characters; ignored...\n";
+ next;
+ }
+
# lint check 1
unless ($pubkey =~ /\.pub$/)
{