From 60cb911d8b74a7466bed4572594fe816325292bd Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Mon, 25 May 2026 10:47:59 -0400 Subject: [PATCH 1/2] Add use with trusted files remark to FileVersionInfo.GetVersionInfo --- .../src/System/Diagnostics/FileVersionInfo.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.cs b/src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.cs index ae883829134874..4a49811b6e5502 100644 --- a/src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.cs +++ b/src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.cs @@ -288,6 +288,11 @@ public string? SpecialBuild /// /// The path and name of the file to retrieve version information for. /// A containing information about the file. If the file did not contain version information, the contains only the name of the file requested. + /// + /// + /// Use this with only trusted files. Malformed or malicious files can cause unexpected behavior. + /// + /// /// does not exist or cannot be accessed. public static FileVersionInfo GetVersionInfo(string fileName) { From 5b145b2d2e0e18bf6cc63a347a16e6f65df58776 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Wed, 27 May 2026 07:11:06 -0400 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../src/System/Diagnostics/FileVersionInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.cs b/src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.cs index 4a49811b6e5502..5d482d3911ef88 100644 --- a/src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.cs +++ b/src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.cs @@ -290,7 +290,7 @@ public string? SpecialBuild /// A containing information about the file. If the file did not contain version information, the contains only the name of the file requested. /// /// - /// Use this with only trusted files. Malformed or malicious files can cause unexpected behavior. + /// Use this only with trusted files. Malformed or malicious files can cause unexpected behavior. /// /// /// does not exist or cannot be accessed.