File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed
tests/RazorPagesTestSample.Tests Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
2
2
.DS_Store
3
+ src /Application /src /RazorPagesTestSample /config.json
Original file line number Diff line number Diff line change @@ -94,7 +94,11 @@ public async Task<IActionResult> OnPostAnalyzeMessagesAsync()
94
94
95
95
public static void WriteToDirectory ( ZipArchiveEntry entry , string destDirectory )
96
96
{
97
- string destFileName = Path . Combine ( destDirectory , entry . FullName ) ;
97
+ string destFileName = Path . GetFullPath ( Path . Combine ( destDirectory , entry . FullName ) ) ;
98
+ string fullDestDirPath = Path . GetFullPath ( destDirectory + Path . DirectorySeparatorChar ) ;
99
+ if ( ! destFileName . StartsWith ( fullDestDirPath ) ) {
100
+ throw new System . InvalidOperationException ( "Entry is outside the target dir: " + destFileName ) ;
101
+ }
98
102
entry . ExtractToFile ( destFileName ) ;
99
103
}
100
104
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 13
13
<PackageReference Include =" Microsoft.EntityFrameworkCore.InMemory" Version =" 8.0.3" />
14
14
<PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.9.0" />
15
15
<PackageReference Include =" Moq" Version =" 4.20.70" />
16
- <PackageReference Include =" Newtonsoft.Json" Version =" 11 .0.2 " />
16
+ <PackageReference Include =" Newtonsoft.Json" Version =" 13 .0.3 " />
17
17
<PackageReference Include =" System.Diagnostics.TraceSource" Version =" 4.3.0" />
18
18
<PackageReference Include =" System.Net.Http" Version =" 4.3.4" />
19
19
<PackageReference Include =" xunit" Version =" 2.7.0" />
You can’t perform that action at this time.
0 commit comments