# HG changeset patch # User Mads Kiilerich # Date 2019-01-08 13:02:34 # Node ID 8d0362047e293ebc76a3630f49a780ff898cec7c # Parent a4a4bcc09ac5506ef81849004d5b60dd18a13c36 middleware: don't allow trailing text after Git commands This is used for determining repos and commands and what access users should have. We thus want to be very strict when parsing these commands. diff --git a/kallithea/lib/middleware/simplegit.py b/kallithea/lib/middleware/simplegit.py --- a/kallithea/lib/middleware/simplegit.py +++ b/kallithea/lib/middleware/simplegit.py @@ -46,7 +46,7 @@ from kallithea.lib.middleware.pygrack im log = logging.getLogger(__name__) -GIT_PROTO_PAT = re.compile(r'^/(.+)/(info/refs|git-upload-pack|git-receive-pack)') +GIT_PROTO_PAT = re.compile(r'^/(.+)/(info/refs|git-upload-pack|git-receive-pack)$') def is_git(environ):