File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed
tests/RazorPagesTestSample.Tests Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 1
1
2
2
.DS_Store
3
+
4
+ # Local configuration file for developers
5
+ src /Application /src /RazorPagesTestSample /config.json
6
+
Original file line number Diff line number Diff line change @@ -94,7 +94,13 @@ 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
+
99
+ if ( ! destFileName . StartsWith ( destDirectory , StringComparison . OrdinalIgnoreCase ) )
100
+ {
101
+ throw new InvalidOperationException ( "Entry is outside of the target directory." ) ;
102
+ }
103
+
98
104
entry . ExtractToFile ( destFileName ) ;
99
105
}
100
106
}
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