List for cgit developers and users
 help / color / mirror / Atom feed
From: mathstuf at gmail.com (Ben Boeckel)
Subject: [PATCHv2 2/3] Add ability to authorize viewing a repository
Date: Sun, 28 Oct 2012 01:29:17 +0000 (UTC)	[thread overview]
Message-ID: <k6i1pd$1c4$1@ger.gmane.org> (raw)
In-Reply-To: <CAHmME9q2nuyEbTL9tueV+dg9+m+W4DtOQ-i3=zzzfs2384hKKQ@mail.gmail.com>

On Sun, Oct 28, 2012 at 01:16:36 GMT, Jason A. Donenfeld wrote:
> On Sat, Oct 27, 2012 at 7:00 PM, Ben Boeckel <mathstuf at gmail.com> wrote:
>> Single quote the arguments to the executable. This is ripe for code
>> execution (remote_user is under attacker's control).
>
> Was going to mention this myself, but you beat me too it. Dead on.
> Correctamundo.
>
> Please double double tripe triple check your code before submitting things.

Working on the uzbl shell scripts (where we require POSIX compatibility
as well) has made these problems stick out like sore thumbs :) . Alas,
secure shell coding isn't the default mode for many programmers :( .
I'll look at the other shell code in cgit this weekend.

> While we're on the topic, is "system" the best way to be calling this?
> Since an auth helper gets called for each and every request, it seems
> like it'd be cleanest if we could just fork/exec/wait ourselves,
> passing the options in to execv. This way we don't have to fire up a
> shell interpreter each time.

Well, that would require that we either shell-split the option (messy
and error prone in and of itself) or effectively require trampoline
scripts for everything due to enforced arguments. Though...something
taking these arguments naturally is unlikely. +1 for fork/exec here.

--Ben





  reply	other threads:[~2012-10-28  1:29 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-16  9:15 [PATCH 0/3] Implement authorization via external program valentin.haenel
2012-10-16  9:15 ` [PATCH 1/3] Add config option user-envvar valentin.haenel
2012-10-28  1:11   ` Jason
2012-10-29  9:49     ` valentin.haenel
2012-10-16  9:15 ` [PATCH 2/3] Add ability to authorize viewing a repository valentin.haenel
2012-10-16 11:21   ` Jason
2012-10-16 12:48     ` valentin.haenel
2012-10-16  9:15 ` [PATCH 2/3] Add ability to authorize viewing a repository using valentin.haenel
2012-10-16  9:17   ` valentin.haenel
2012-10-16  9:15 ` [PATCH 3/3] Helper script to interface to gitolite valentin.haenel
2012-10-22  8:29 ` [PATCHv2 1/3] Add config option user-envvar valentin.haenel
2012-10-28  1:00   ` mathstuf
2012-10-29  9:22     ` valentin.haenel
2012-10-29 14:53       ` mathstuf
2012-10-29 15:50         ` valentin.haenel
2012-10-22  8:29 ` [PATCHv2 2/3] Add ability to authorize viewing a repository valentin.haenel
2012-10-28  1:00   ` mathstuf
2012-10-28  1:16     ` Jason
2012-10-28  1:29       ` mathstuf [this message]
2012-10-28  1:33         ` Jason
2012-10-29  9:43       ` valentin.haenel
2012-10-29 14:52         ` mathstuf
2012-10-29 15:45           ` valentin.haenel
2012-10-28  1:17     ` Jason
2012-10-29 12:38       ` valentin.haenel
2012-10-30  9:54         ` valentin.haenel
2012-10-28  1:14   ` Jason
2012-10-29  9:36     ` valentin.haenel
2012-10-22  8:29 ` [PATCHv2 3/3] Helper script to interface to gitolite valentin.haenel
2012-10-28  1:00   ` mathstuf
2012-10-29  9:27     ` valentin.haenel
2012-10-30 10:11 ` [PATCHv3 0/3] Implement authorization via external program (v3) valentin.haenel
2012-10-30 15:04   ` mathstuf
2012-10-30 16:30   ` Jason
2012-10-30 10:11 ` [PATCHv3 1/3] Add config option user-envvar valentin.haenel
2012-10-30 16:29   ` Jason
2012-10-30 10:11 ` [PATCHv3 2/3] Add ability to authorize viewing a repository valentin.haenel
2012-10-30 16:30   ` Jason
2012-10-30 10:11 ` [PATCHv3 3/3] Helper script to interface to gitolite valentin.haenel
2012-10-30 15:05   ` mathstuf
2012-10-31 18:50 ` [PATCHv4 0/2] Authorize viewing a repository valentin.haenel
2012-10-31 18:52   ` [PATCHv4 1/2] Add ability to authorize " valentin.haenel
2012-10-31 18:52   ` [PATCHv4 2/2] Helper script to interface to gitolite valentin.haenel
2012-11-01  3:03     ` jamie.couture
2012-11-01  3:23       ` mathstuf
2012-11-01  4:20         ` Jason
2012-11-01  4:31           ` mathstuf
2012-11-01  8:58           ` valentin.haenel
2012-11-01 17:32             ` Jason
2012-11-01 10:40   ` [PATCHv4 0/2] Authorize viewing a repository valentin.haenel
2012-11-01 17:27     ` Jason
2012-11-01 17:32       ` valentin.haenel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='k6i1pd$1c4$1@ger.gmane.org' \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).