Test that incoming paths cannot contain /../
This commit is contained in:
parent
e1d150daf5
commit
f7bcd554fa
|
@ -57,6 +57,18 @@ def test_bad_unsafeArguments():
|
||||||
eq(str(e), 'Arguments to command look dangerous')
|
eq(str(e), 'Arguments to command look dangerous')
|
||||||
assert isinstance(e, serve.ServingError)
|
assert isinstance(e, serve.ServingError)
|
||||||
|
|
||||||
|
def test_bad_unsafeArguments_dotdot():
|
||||||
|
cfg = RawConfigParser()
|
||||||
|
e = assert_raises(
|
||||||
|
serve.UnsafeArgumentsError,
|
||||||
|
serve.serve,
|
||||||
|
cfg=cfg,
|
||||||
|
user='jdoe',
|
||||||
|
command='git-upload-pack something/../evil',
|
||||||
|
)
|
||||||
|
eq(str(e), 'Arguments to command look dangerous')
|
||||||
|
assert isinstance(e, serve.ServingError)
|
||||||
|
|
||||||
def test_bad_forbiddenCommand_read():
|
def test_bad_forbiddenCommand_read():
|
||||||
cfg = RawConfigParser()
|
cfg = RawConfigParser()
|
||||||
e = assert_raises(
|
e = assert_raises(
|
||||||
|
|
Loading…
Reference in a new issue