From 9cb181a8abe2589deac2f3331773d045ae4009ad Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Tue, 28 Jul 2020 14:54:16 -0400 Subject: [PATCH] Regression test log file exploit --- tests/Tgstation.Server.Tests/AdministrationTest.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/Tgstation.Server.Tests/AdministrationTest.cs b/tests/Tgstation.Server.Tests/AdministrationTest.cs index f3fb7c1155..7562c33d93 100644 --- a/tests/Tgstation.Server.Tests/AdministrationTest.cs +++ b/tests/Tgstation.Server.Tests/AdministrationTest.cs @@ -1,4 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Linq; using System.Runtime.InteropServices; @@ -43,6 +43,11 @@ namespace Tgstation.Server.Tests { Name = "very_fake_path.log" }, cancellationToken), ErrorCode.IOError); + + await Assert.ThrowsExceptionAsync(() => client.GetLog(new LogFile + { + Name = "../out_of_bounds.file" + }, cancellationToken)); } async Task TestRead(CancellationToken cancellationToken)