Regression test log file exploit

This commit is contained in:
Jordan Brown
2020-07-28 14:54:16 -04:00
parent 6f6a6035a8
commit 9cb181a8ab
@@ -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<InsufficientPermissionsException>(() => client.GetLog(new LogFile
{
Name = "../out_of_bounds.file"
}, cancellationToken));
}
async Task TestRead(CancellationToken cancellationToken)