Skip to content

Commit

Permalink
security: gitolite admin can get shell access by using screwy pubkey …
Browse files Browse the repository at this point in the history
…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!)
  • Loading branch information
sitaramc committed Apr 9, 2010
1 parent e6ee5cd commit 5deffee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gl-compile-conf
Expand Up @@ -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$/)
{
Expand Down

0 comments on commit 5deffee

Please sign in to comment.