Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Http/Http.Features/src/IFormFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ public interface IFormFile
/// <summary>
/// Gets the file name from the Content-Disposition header.
/// </summary>
/// <remarks>
/// Do not use the <see cref="FileName"/> property of <see cref="IFormFile"/> other than for display and logging.
/// When displaying or logging, HTML encode the file name. A cyberattacker can provide a malicious filename, including full paths or relative paths.
/// <para>
/// You can use the following code to remove the path from the file name:
/// </para>
/// <code>
/// string untrustedFileName = Path.GetFileName(formFile.FileName);
/// </code>
/// </remarks>
string FileName { get; }

/// <summary>
Expand Down
Loading