diff --git a/src/BinSkim.Rules/PERules/BA2025.EnableShadowStack.cs b/src/BinSkim.Rules/PERules/BA2025.EnableShadowStack.cs new file mode 100644 index 000000000..e0ac25b34 --- /dev/null +++ b/src/BinSkim.Rules/PERules/BA2025.EnableShadowStack.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Collections.Generic; +using System.Composition; +using System.Reflection.PortableExecutable; + +using Microsoft.CodeAnalysis.BinaryParsers; +using Microsoft.CodeAnalysis.BinaryParsers.PortableExecutable; +using Microsoft.CodeAnalysis.IL.Sdk; +using Microsoft.CodeAnalysis.Sarif; +using Microsoft.CodeAnalysis.Sarif.Driver; + +namespace Microsoft.CodeAnalysis.IL.Rules +{ + [Export(typeof(Skimmer)), Export(typeof(ReportingDescriptor))] + public class EnableShadowStack : WindowsBinaryAndPdbSkimmerBase + { + private const int IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS = 20; + private const ushort IMAGE_DLLCHARACTERISTICS_EX_CET_COMPAT = 0x001; + + /// + /// BA2025 + /// + public override string Id => RuleIds.EnableShadowStack; + + /// + /// Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature + /// that provides capabilities to defend against return-oriented programming (ROP) based + /// malware attacks. + /// + public override MultiformatMessageString FullDescription => new MultiformatMessageString + { + Text = RuleResources.BA2025_EnableShadowStack_Description + }; + + protected override IEnumerable MessageResourceNames => new string[] { + nameof(RuleResources.BA2025_Pass), + nameof(RuleResources.BA2025_Warning), + nameof(RuleResources.NotApplicable_InvalidMetadata) + }; + + public override AnalysisApplicability CanAnalyzePE(PEBinary target, Sarif.PropertiesDictionary policy, out string reasonForNotAnalyzing) + { + PE portableExecutable = target.PE; + AnalysisApplicability notApplicable = AnalysisApplicability.NotApplicableToSpecifiedTarget; + + if (portableExecutable.IsILOnly) + { + reasonForNotAnalyzing = MetadataConditions.ImageIsILOnlyAssembly; + return notApplicable; + } + + if (portableExecutable.IsResourceOnly) + { + reasonForNotAnalyzing = MetadataConditions.ImageIsResourceOnlyBinary; + return notApplicable; + } + + if (portableExecutable.IsNativeUniversalWindowsPlatform) + { + reasonForNotAnalyzing = MetadataConditions.ImageIsNativeUniversalWindowsPlatformBinary; + return notApplicable; + } + + reasonForNotAnalyzing = null; + return AnalysisApplicability.ApplicableToSpecifiedTarget; + } + + public override void AnalyzePortableExecutableAndPdb(BinaryAnalyzerContext context) + { + PEBinary target = context.PEBinary(); + IEnumerable debugDirectories = target.PE.DebugDirectories; + + if (debugDirectories == null) + { + return; + } + + foreach (DebugDirectoryEntry debugDirectory in debugDirectories) + { + if (debugDirectory.Type == (DebugDirectoryEntryType)IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS) + { + PEMemoryBlock memory = target.PE.GetSectionData(debugDirectory.DataRelativeVirtualAddress); + if ((memory.GetReader().ReadUInt16() & IMAGE_DLLCHARACTERISTICS_EX_CET_COMPAT) == IMAGE_DLLCHARACTERISTICS_EX_CET_COMPAT) + { + // '{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. + context.Logger.Log(this, + RuleUtilities.BuildResult(ResultKind.Pass, context, null, + nameof(RuleResources.BA2025_Pass), + context.TargetUri.GetFileName())); + return; + } + } + } + + // '{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. + // To resolve this issue, pass /CETCOMPAT on the linker command lines. + context.Logger.Log(this, + RuleUtilities.BuildResult(FailureLevel.Warning, context, null, + nameof(RuleResources.BA2025_Warning), + context.TargetUri.GetFileName())); + } + } +} diff --git a/src/BinSkim.Rules/RuleIds.cs b/src/BinSkim.Rules/RuleIds.cs index 6ee77a166..e2f3d6824 100644 --- a/src/BinSkim.Rules/RuleIds.cs +++ b/src/BinSkim.Rules/RuleIds.cs @@ -39,6 +39,7 @@ internal static class RuleIds public const string SignSecurely = "BA2022"; public const string EnableSpectreMitigations = "BA2024"; + public const string EnableShadowStack = "BA2025"; // ELF Checks public const string EnablePositionIndependentExecutable = "BA3001"; @@ -50,6 +51,7 @@ internal static class RuleIds // Skipping some check namespace (BA3004-3009) for future checks public const string EnableReadOnlyRelocations = "BA3010"; + public const string EnableBindNow = "BA3011"; // BA3012-3029 -- saved for future non-compiler/language specific checks. diff --git a/src/BinSkim.Rules/RuleResources.Designer.cs b/src/BinSkim.Rules/RuleResources.Designer.cs index 366a8efb1..f15ea81d5 100644 --- a/src/BinSkim.Rules/RuleResources.Designer.cs +++ b/src/BinSkim.Rules/RuleResources.Designer.cs @@ -924,7 +924,34 @@ internal static string BA2024_Warning_SpectreMitigationNotEnabled { } /// - /// Looks up a localized string similar to A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc.. + /// Looks up a localized string similar to Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks.. + /// + internal static string BA2025_EnableShadowStack_Description { + get { + return ResourceManager.GetString("BA2025_EnableShadowStack_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation.. + /// + internal static string BA2025_Pass { + get { + return ResourceManager.GetString("BA2025_Pass", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines.. + /// + internal static string BA2025_Warning { + get { + return ResourceManager.GetString("BA2025_Warning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc.. /// internal static string BA3001_EnablePositionIndependentExecutable_Description { get { diff --git a/src/BinSkim.Rules/RuleResources.resx b/src/BinSkim.Rules/RuleResources.resx index 77f4ae461..7b12de7ff 100644 --- a/src/BinSkim.Rules/RuleResources.resx +++ b/src/BinSkim.Rules/RuleResources.resx @@ -1,520 +1,529 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - '{0}' is a 64-bit image with a preferred base address below the 4GB boundary. Having a preferred base address below this boundary triggers a compatibility mode in Address Space Layout Randomization (ASLR) on recent versions of Windows that reduces the number of locations to which ASLR may relocate the binary. This reduces the effectiveness of ASLR at mitigating memory corruption vulnerabilities. To resolve this issue, either use the default preferred base address by removing any uses of /baseaddress from compiler command lines, or /BASE from linker command lines (recommended), or configure your program to start at a base address above 4GB when compiled for 64 bit platforms (by changing the constant passed to /baseaddress or /BASE). Note that if you choose to continue using a custom preferred base address, you will need to make this modification only for 64-bit builds, as base addresses above 4GB are not valid for 32-bit binaries. - - - 64-bit images should have a preferred base address above the 4GB boundary to prevent triggering an Address Space Layout Randomization (ASLR) compatibility mode that decreases security. ASLR compatibility mode reduces the number of locations to which ASLR may relocate the binary, reducing its effectiveness at mitigating memory corruption vulnerabilities. To resolve this issue, either use the default preferred base address by removing any uses of /baseaddress from compiler command lines, or /BASE from linker command lines (recommended), or configure your program to start at a base address above 4GB when compiled for 64 bit platforms (by changing the constant passed to /baseaddress or /BASE). Note that if you choose to continue using a custom preferred base address, you will need to make this modification only for 64-bit builds, as base addresses above 4GB are not valid for 32-bit binaries. - - - '{0}' is a 64-bit image with a base address that is >= 4 gigabytes, increasing the effectiveness of Address Space Layout Randomization (which helps prevent attackers from executing security-sensitive code in well-known locations). - - - Binaries should not take dependencies on code with known security vulnerabilities. - - - '{0}' was built with a version of {1} which is subject to the following issues: {2}. To resolve this, {3}. The source files that triggered this were: {4} - - - '{0}' does not incorporate any known vulnerable dependencies, as configured by current policy. - - - Do not ship obsolete libraries for which there are known security vulnerabilities. - - - '{0}' appears to be an obsolete library (version {1}) for which there are known security vulnerabilities. To resolve this issue, obtain a version of {0} that is newer than version {2}. If this binary is not in fact {0}, ignore this warning. - - - Version information for '{0}' could not be parsed. The binary therefore could not be verified not to be an obsolete binary that is known to be vulnerable to one or more security problems. - - - vulnerable binary name and version metadata - - - '{0}' is not known to be an obsolete binary that is vulnerable to one or more security problems. - - - Application code should be compiled with the most up-to-date tool sets possible to take advantage of the most current compile-time security features. Among other things, these features provide address space layout randomization, help prevent arbitrary code execution, and enable code generation that can help prevent speculative execution side-channel attacks. - - - '{0}' was compiled with one or more modules which were not built using minimum required tool versions (compiler version {1}). More recent toolchains contain mitigations that make it more difficult for an attacker to exploit vulnerabilities in programs they produce. To resolve this issue, compile and/or link your binary with more recent tools. If you are servicing a product where the tool chain cannot be modified (e.g. producing a hotfix for an already shipped version) ignore this warning. Modules built outside of policy: -{2} - - - built with {0} compiler version {1} (Front end version {2}) - - - All linked modules of '{0}' satisfy configured policy (observed compilers: {1}). - - - Binaries should be compiled with a warning level that enables all critical security-relevant checks. Enabling at least warning level 3 enables important static analysis in the compiler that can identify bugs with a potential to provoke memory corruption, information disclosure, or double-free vulnerabilities. To resolve this issue, compile at warning level 3 or higher by supplying /W3, /W4, or /Wall to the compiler, and resolve the warnings emitted. - - - '{0}' was compiled at too low a warning level (effective warning level {1} for one or more modules). Warning level 3 enables important static analysis in the compiler to flag bugs that can lead to memory corruption, information disclosure, or double-free vulnerabilities. To resolve this issue, compile at warning level 3 or higher by supplying /W3, /W4, or /Wall to the compiler, and resolve the warnings emitted. An example compiler command line triggering this check: {2} -Modules triggering this check: {3} - - - '{0}' contains code from an unknown language, preventing a comprehensive analysis of the compiler warning settings. The language could not be identified for the following modules: {1} - - - '{0}' disables compiler warning(s) which are required by policy. A compiler warning is typically required if it has a high likelihood of flagging memory corruption, information disclosure, or double-free vulnerabilities. To resolve this issue, enable the indicated warning(s) by removing /Wxxxx switches (where xxxx is a warning id indicated here) from your command line, and resolve any warnings subsequently raised during compilation. An example compiler command line triggering this check was: {1} -Modules triggering this check were: -{2} - - - '{0}' was compiled at a secure warning level ({1}) and does not include any modules that disable specific warnings that are required by policy. As a result, it is less likely that memory corruption, information disclosure, double-free and other security-related vulnerabilities exist in code. - - - Binaries should enable the compiler control guard feature (CFG) at build time to prevent attackers from redirecting execution to unexpected, unsafe locations. CFG analyzes and discovers all indirect-call instructions at compilation and link time. It also injects a check that precedes every indirect call in code that ensures the target is an expected, safe location. If that check fails at runtime, the operating system will close the program. - - - '{0}' does not enable the control flow guard (CFG) mitigation. To resolve this issue, pass /guard:cf on both the compiler and linker command lines. Binaries also require the /DYNAMICBASE linker option in order to enable CFG. - - - '{0}' is a kernel mode portable executable compiled for a version of Windows that does not support the control flow guard feature for kernel mode binaries. - - - '{0}' enables the control flow guard mitigation. As a result, the operating system will force an application to close if an attacker is able to redirect execution in the component to an unexpected location. - - - Binaries should linked as DYNAMICBASE to be eligible for relocation by Address Space Layout Randomization (ASLR). ASLR is an important mitigation that makes it more difficult for an attacker to exploit memory corruption vulnerabilities. Configure your tools to build with this feature enabled. For C and C++ binaries, add /DYNAMICBASE to your linker command line. For .NET applications, use a compiler shipping with Visual Studio 2008 or later. - - - '{0}' is not marked as DYNAMICBASE. This means that the binary is not eligible for relocation by Address Space Layout Randomization (ASLR). ASLR is an important mitigation that makes it more difficult for an attacker to exploit memory corruption vulnerabilities. To resolve this issue, configure your tools to build with this feature enabled. For C and C++ binaries, add /DYNAMICBASE to your linker command line. For .NET applications, use a compiler shipping with Visual Studio 2008 or later. - - - '{0}' is marked as DYNAMICBASE but relocation data has been stripped from the image, preventing address space layout randomization. - - - '{0}' is a Windows CE image but does not contain any relocation data, preventing Address Space Layout Randomization. - - - '{0}' is properly compiled to enable Address Space Layout Randomization, reducing an attacker's ability to exploit code in well-known locations. - - - PE sections should not be marked as both writable and executable. This condition makes it easier for an attacker to exploit memory corruption vulnerabilities, as it may provide an attacker executable location(s) to inject shellcode. Because the loader will always mark the imports section as writable, it is therefore important to mark this section as non-executable. To resolve this issue, ensure that your program does not mark the imports section executable. Look for uses of /SECTION or /MERGE on the linker command line, or #pragma segment in source code, which change the imports section to be executable, or which merge the ".rdata" segment into an executable section. - - - '{0}' has the imports section marked executable. Because the loader will always mark the imports section as writable, it is important to mark this section as non-executable, so that an attacker cannot place shellcode here. To resolve this issue, ensure that your program does not mark the imports section as executable. Look for uses of /SECTION or /MERGE on the linker command line, or #pragma segment in source code, which change the imports section to be executable, or which merge the ".rdata" segment into an executable section. - - - '{0}' does not have an imports section that is marked as executable, helping to prevent the exploitation of code vulnerabilities. - - - Binaries should be built with the stack protector buffer security feature (/GS) enabled to increase the difficulty of exploiting stack buffer overflow memory corruption vulnerabilities. To resolve this issue, ensure that all modules compiled into the binary are compiled with the stack protector enabled by supplying /GS on the Visual C++ compiler command line. - - - '{0}' is a C or C++ binary built with the stack protector buffer security feature disabled in one or more modules. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. To resolve this issue, ensure that your code is compiled with the stack protector enabled by supplying /GS on the Visual C++ compiler command line. The affected modules were: {1} - - - '{0}' contains code from an unknown language, preventing a comprehensive analysis of the stack protector buffer security features. The language could not be identified for the following modules: {1}. - - - '{0}' is a C or C++ binary built with the stack protector buffer security feature enabled for all modules, making it more difficult for an attacker to exploit stack buffer overflow memory corruption vulnerabilities. - - - Application code should not interfere with the stack protector. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. The stack protector relies on a random number, called the "security cookie", to detect these buffer overflows. This 'cookie' is statically linked with your binary from a Visual C++ library in the form of the symbol __security_cookie. On recent Windows versions, the loader looks for the statically linked value of this cookie, and initializes the cookie with a far better source of entropy -- the system's secure random number generator -- rather than the limited random number generator available early in the C runtime startup code. When this symbol is not the default value, the additional entropy is not injected by the operating system, reducing the effectiveness of the stack protector. To resolve this issue, ensure that your code does not reference or create a symbol named __security_cookie or __security_cookie_complement. - - - '{0}' is a C or C++ binary that interferes with the stack protector. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. The stack protector relies on a random number, called the "security cookie", to detect these buffer overflows. This 'cookie' is statically linked with your binary from a Visual C++ library in the form of the symbol __security_cookie. On recent Windows versions, the loader looks for the magic statically linked value of this cookie, and initializes the cookie with a far better source of entropy -- the system's secure random number generator -- rather than the limited random number generator available early in the C runtime startup code. When this symbol is not the default value, the additional entropy is not injected by the operating system, reducing the effectiveness of the stack protector. To resolve this issue, ensure that your code does not reference or create a symbol named __security_cookie or __security_cookie_complement. NOTE: the modified cookie value detected was: {1} - - - '{0}' is a C or C++binary that enables the stack protection feature but the security cookie could not be located. The binary may be corrupted. - - - '{0}' is a C or C++ binary built with the buffer security feature that properly preserves the stack protecter cookie. This has the effect of enabling a significant increase in entropy provided by the operating system over that produced by the C runtime start-up code. - - - '{0}' is C or C++binary that does not contain a load config table, which indicates either that it was compiled and linked with a version of the compiler that precedes stack protection features or is a binary (such as an ngen'ed assembly) that is not subject to relevant security issues. - - - '{0}' appears to be a packed C or C++ binary that reports a security cookie offset that exceeds the size of the packed file. Use of the stack protector (/GS) feature therefore could not be verified. The file was possibly packed by: {1}. - - - '{0}' appears to be a packed C or C++ binary that reports a security cookie offset that exceeds the size of the packed file. Use of the stack protector (/GS) feature therefore could not be verified. The file was possibly packed by: {1}. - - - '{0}' is a C or C++ binary that does not initialize the stack protector. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. The stack protector requires access to entropy in order to be effective, which means a binary must initialize a random number generator at startup, by calling __security_init_cookie() as close to the binary's entry point as possible. Failing to do so will result in spurious buffer overflow detections on the part of the stack protector. To resolve this issue, use the default entry point provided by the C runtime, which will make this call for you, or call __security_init_cookie() manually in your custom entry point. - - - Binaries should properly initialize the stack protector (/GS) in order to increase the difficulty of exploiting stack buffer overflow memory corruption vulnerabilities. The stack protector requires access to entropy in order to be effective, which means a binary must initialize a random number generator at startup, by calling __security_init_cookie() as close to the binary's entry point as possible. Failing to do so will result in spurious buffer overflow detections on the part of the stack protector. To resolve this issue, use the default entry point provided by the C runtime, which will make this call for you, or call __security_init_cookie() manually in your custom entry point. - - - '{0}' is a C or C++ binary that does not enable the stack protection buffer security feature. It is therefore not required to initialize the stack protector. - - - '{0}' is a C or C++ binary built with the buffer security feature that properly initializes the stack protecter. This has the effect of increasing the effectiveness of the feature and reducing spurious detections. - - - '{0}' is a C or C++ binary that is not required to initialize the stack protection, as it does not contain executable code. - - - Application code should not disable stack protection for individual functions. The stack protector (/GS) is a security feature of the Windows native compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. Disabling the stack protector, even on a function-by-function basis, can compromise the security of code. To resolve this issue, remove occurrences of __declspec(safebuffers) from your code. If the additional code inserted by the stack protector has been shown in profiling to cause a significant performance problem for your application, attempt to move stack buffer modifications out of the hot path of execution to allow the compiler to avoid inserting stack protector checks in these locations rather than disabling the stack protector altogether. - - - '{0}' is a C or C++ binary built with function(s) ({1}) that disable the stack protector. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. Disabling the stack protector, even on a function-by-function basis, is disallowed by SDL policy. To resolve this issue, remove occurrences of __declspec(safebuffers) from your code. If the additional code inserted by the stack protector has been shown in profiling to cause a significant performance problem for your application, attempt to move stack buffer modifications out of the hot path of execution to allow the compiler to avoid inserting stack protector checks in these locations rather than disabling the stack protector altogether. - - - '{0}' is a C or C++ binary built with the stack protector buffer security feature enabled which does not disable protection for any individual functions (via __declspec(safebuffers), making it more difficult for an attacker to exploit stack buffer overflow memory corruption vulnerabilities. - - - Binaries should be marked as high entropy Address Space Layout Randomization (ASLR) compatible. High entropy allows ASLR to be more effective in mitigating memory corruption vulnerabilities. To resolve this issue, configure your tool chain to mark the program high entropy compatible; e.g. by supplying /HIGHENTROPYVA to the C or C++ linker command line. Binaries must also be compiled as /LARGEADDRESSAWARE in order to enable high entropy ASLR. - - - '{0}' does not declare itself as high entropy ASLR compatible. High entropy makes Address Space Layout Randomization more effective in mitigating memory corruption vulnerabilities. To resolve this issue, configure your tools to mark the program high entropy compatible; e.g. by supplying /HIGHENTROPYVA as well as /LARGEADDRESSAWARE to the C or C++ linker command line. - - - '{0}' does not declare itself as high entropy ASLR compatible. High entropy makes Address Space Layout Randomization more effective in mitigating memory corruption vulnerabilities. To resolve this issue, configure your tools to mark the program high entropy compatible; e.g. by supplying /HIGHENTROPYVA to the C or C++ linker command line. (This image was determined to have been properly compiled as /LARGEADDRESSAWARE.) - - - '{0}' does not declare itself as high entropy ASLR compatible. High entropy makes Address Space Layout Randomization more effective in mitigating memory corruption vulnerabilities. To resolve this issue, configure your tools to mark the program high entropy compatible by supplying /LARGEADDRESSAWARE to the C or C++ linker command line. (This image was determined to have been properly compiled as /HIGHENTROPYVA.) - - - '{0}' is high entropy ASLR compatible, reducing an attacker's ability to exploit code in well-known locations. - - - '{0}' is not marked NX compatible. The NXCompat bit, also known as "Data Execution Prevention" (DEP) or "Execute Disable" (XD), is a processor feature that allows a program to mark a piece of memory as non-executable. This helps mitigate memory corruption vulnerabilities by preventing an attacker from supplying direct shellcode in their exploit, because the exploit comes in the form of input data to the exploited program on a data segment, rather than on an executable code segment. To resolve this issue, ensure that your tools are configured to mark your binaries as NX compatible, e.g. by passing /NXCOMPAT to the C/C++ linker. - - - Binaries should be marked as NX compatible to help prevent execution of untrusted data as code. The NXCompat bit, also known as "Data Execution Prevention" (DEP) or "Execute Disable" (XD), triggers a processor security feature that allows a program to mark a piece of memory as non-executable. This helps mitigate memory corruption vulnerabilities by preventing an attacker from supplying direct shellcode in their exploit (because the exploit comes in the form of input data to the exploited program on a data segment, rather than on an executable code segment). Ensure that your tools are configured to mark your binaries as NX compatible, e.g. by passing /NXCOMPAT to the C/C++ linker. - - - '{0}' is marked as NX compatible, helping to prevent attackers from executing code that is injected into data segments. - - - X86 binaries should enable the SafeSEH mitigation to minimize exploitable memory corruption issues. SafeSEH makes it more difficult to exploit vulnerabilities that permit overwriting SEH control blocks on the stack, by verifying that the location to which a thrown SEH exception would jump is indeed defined as an exception handler in the source program (and not shellcode). To resolve this issue, supply the /SafeSEH flag on the linker command line. Note that you will need to configure your build system to supply this flag for x86 builds only, as the /SafeSEH flag is invalid when linking for ARM and x64. - - - '{0}' is an x86 binary which {1}, indicating that it does not enable the SafeSEH mitigation. SafeSEH makes it more difficult to exploit memory corruption vulnerabilities that can overwrite SEH control blocks on the stack, by verifying that the location to which a thrown SEH exception would jump is indeed defined as an exception handler in the source program (and not shellcode). To resolve this issue, supply the /SafeSEH flag on the linker command line. Note that you will need to configure your build system to supply this flag for x86 builds only, as the /SafeSEH flag is invalid when linking for ARM and x64. - - - has an empty SE handler table in the load configuration table - - - contains an unexpectedly small load configuration table {size 0} - - - does not contain a load configuration table - - - has zero SE handlers in the load configuration table - - - '{0}' is an x86 binary that enables SafeSEH, a mitigation that verifies SEH exception jump targets are defined as exception handlers in the program (and not shellcode). - - - '{0}' is an x86 binary that does not use SEH, making it an invalid target for exploits that attempt to replace SEH jump targets with attacker-controlled shellcode. - - - Code or data sections should not be marked as both shared and writable. Because these sections are shared across processes, this condition might permit a process with low privilege to alter memory in a higher privilege process. If you do not actually require that a section be both writable and shared, remove one or both of these attributes (by modifying your .DEF file, the appropriate linker /section switch arguments, etc.). If you must share common data across processes (for inter-process communication (IPC) or other purposes) use CreateFileMapping with proper security attributes or an actual IPC mechanism instead (COM, named pipes, LPC, etc.). - - - '{0}' contains one or more code or data sections ({1}) which are marked as both shared and writable. Because these sections are shared across processes, this condition might permit a process with low privilege to alter memory in a higher privilege process. If you do not actually require that a section be both writable and shared, remove one or both of these attributes (by modifying your .DEF file, the appropriate linker /section switch arguments, etc.). If you must share common data across processes (for inter-process communication (IPC) or other purposes) use CreateFileMapping with proper security attributes or an actual IPC mechanism instead (COM, named pipes, LPC, etc.). - - - '{0}' contains no data or code sections marked as both shared and writable, helping to prevent the exploitation of code vulnerabilities. - - - PE sections should not be marked as both writable and executable. This condition makes it easier for an attacker to exploit memory corruption vulnerabilities, as it may provide an attacker executable location(s) to inject shellcode. To resolve this issue, configure your tools to not emit memory sections that are writable and executable. For example, look for uses of /SECTION on the linker command line for C and C++ programs, or #pragma section in C and C++ source code, which mark a section with both attributes. Be sure to disable incremental linking in release builds, as this feature creates a writable and executable section named '.textbss' in order to function. - - - '{0}' contains PE section(s) ({1}) that are both writable and executable. Writable and executable memory segments make it easier for an attacker to exploit memory corruption vulnerabilities, because it may provide an attacker executable location(s) to inject shellcode. To resolve this issue, configure your tools to not emit memory sections that are writable and executable. For example, look for uses of /SECTION on the linker command line for C and C++ programs, or #pragma section in C and C++ source code, which mark a section with both attributes. Enabling incremental linking via the /INCREMENTAL argument (the default for Microsoft Visual Studio debug build) can also result in a writable and executable section named 'textbss'. For this case, disable incremental linking (or analyze an alternate build configuration that disables this feature) to resolve the problem. - - - '{0}' has a section alignment ({1}) that is smaller than its page size ({2}). - - - '{0}' contains no data or code sections marked as both shared and executable, helping to prevent the exploitation of code vulnerabilities. - - - '{0}' was signed exclusively with algorithms that WinTrustVerify has flagged as insecure. {1} - - - '{0}' signing was flagged as insecure by WinTrustVerify with error code '{1}' ({2}) - - - '{0}' signing could not be completely verified because '{1}' failed with error code: '{2}'. - - - '{0}' appears to be signed with secure cryptographic algorithms. WinTrustVerify successfully validated the binary but did not attempt to validate certificate chaining or that the root certificate is trusted. The following digitial signature algorithms were detected: {1} - - - Images should be correctly signed by trusted publishers using cryptographically secure signature algorithms. This rule invokes WinTrustVerify to validate that binary hash, signing and public key algorithms are secure and, where configurable, that key sizes meet acceptable size thresholds. - - - Application code should be compiled with the Spectre mitigations switch (/Qspectre) and toolsets that support it. - - - '{0}' was compiled with one or more modules that do not enable code generation mitigations for speculative execution side-channel attack (Spectre) vulnerabilities. Spectre attacks can compromise hardware-based isolation, allowing non-privileged users to retrieve potentially sensitive data from the CPU cache. To resolve the issue, provide the /Qspectre switch on the compiler command-line (or /d2guardspecload in cases where your compiler supports this switch and it is not possible to update to a toolset that supports /Qspectre). This warning should be addressed for code that operates on data that crosses a trust boundary and that can affect execution, such as parsing untrusted file inputs or processing query strings of a web request. -{1} - - - The following MASM modules were detected. The MASM compiler does not currently mitigate against speculative execution attacks: -{0} - - - The following modules were compiled with optimizations disabled (/Od), a condition that disables Spectre mitigations: -{0} - - - The following modules were compiled with Spectre mitigations explicitly disabled: -{0} - - - The following modules were compiled with a toolset that supports /Qspectre but the switch was not enabled on the command-line: -{0} - - - The MitigatedCompilers configuration entry was incorrect, either because version numbers overlapped or because a starting version number was higher than an ending version number. - - - All linked modules '{0}' were compiled with mitigations enabled that help prevent Spectre (speculative execution side-channel attack) vulnerabilities. - - - The following modules were compiled with a toolset that supports /Qspectre but the deprecated /d2guardspecload argument was specified on the command-line instead: {0} - - - A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc. - - - PIE disabled on executable '{0}'. This means the code section will always be loaded to the same address, even if ASLR is enabled in the Linux kernel. To address this, ensure you are compiling with '-fpie' when using clang/gcc. - - - PIE enabled on executable '{0}'. - - - '{0}' is a shared object library rather than an executable, and is automatically position independent. - - - This checks if a binary has an executable stack; an executable stack allows attackers to redirect code flow into stack memory, which is an easy place for an attacker to store shellcode. Ensure you are compiling with '-z noexecstack' to mark the stack as non-executable. - - - GNU_STACK segment on '{0}' is missing, which means the stack will likely be loaded as executable. Ensure you are using an up to date compiler and passing '-z noexecstack' to the compiler. - - - Stack on '{0}' is executable, which means that an attacker could use it as a place to store attack shellcode. Ensure you are compiling with '-z noexecstack' to mark the stack as non-executable. - - - GNU_STACK segment marked as non-executable on '{0}'. - - - The stack protector ensures that all functions that use buffers over a certain size will use a stack cookie (and check it) to prevent stack based buffer overflows, exiting if stack smashing is detected. Use '--fstack-protector-strong' (all buffers of 4 bytes or more) or '--fstack-protector-all' (all functions) to enable this. - - - The stack protector was not found in '{0}'. This may be because the binary has no stack-based arrays, or because '--stack-protector-strong' was not used. - - - Stack protector was found on '{0}'. However, if you are not compiling with '--stack-protector-strong', it may provide additional protections. - - - This check ensures that some relocation data is marked as read only after the executable is loaded, and moved below the '.data' section in memory. This prevents them from being overwritten, which can redirect control flow. Use the compiler flags '-Wl,z,relro' to enable this. - - - The GNU_RELRO segment is missing from this binary, so relocation sections in '{0}' will not be marked as read only after the binary is loaded. An attacker can overwrite these to redirect control flow. Ensure you are compiling with the compiler flags '-Wl,z,relro' to address this. - - - The GNU_RELRO segment was present, so '{0}' is protected. - - - This check ensures that some relocation data is marked as read only after the executable is loaded, and moved below the '.data' section in memory. This prevents them from being overwritten, which can redirect control flow. Use the compiler flags '-Wl,z,now' to enable this. - - - The BIND_NOW flag is missing from this binary, so relocation sections in '{0}' will not be marked as read only after the binary is loaded. An attacker can overwrite these to redirect control flow. Ensure you are compiling with the compiler flags '-Wl,z,now' to address this. - - - The BIND_NOW flag was present, so '{0}' is protected. - - - No checked functions are present/used when compiling '{0}', and it was compiled with GCC--and it uses functions that can be checked. The Fortify Source flag replaces some unsafe functions with checked versions when a static length can be determined, and can be enabled by passing '-D_FORTIFY_SOURCE=2' when optimization level 2 ('-O2') is enabled. It is possible that the flag was passed, but that the compiler could not statically determine the length of any buffers/strings. - - - All functions that can be checked in '{0}' are using the checked versions, so this binary is protected from overflows caused by those function's use. - - - No unsafe functions which can be replaced with checked versions are used in '{0}'. - - - Some checked functions were found in '{0}'; however, there were also some unchecked functions, which can occur when the compiler cannot statically determine the length of a buffer/string. We recommend reviewing your usage of functions like memcpy or strcpy. - - - GCC can automatically replace unsafe functions with checked variants when it can statically determine the length of a buffer or string. In the case of an overflow, the checked version will safely exit the program (rather than potentially allowing an exploit). This feature can be enabled by passing '-DFortify_Source=2' when optimization level 2 is enabled ('-O2'). - - - '{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}. - - - This check is not supported on the '{0}' platform, as it requires interoperability with a native Windows library. - - - '{0}' was not evaluated for check '{1}' because its PDB could not be loaded ({2}). - - - Could not locate the PDB for '{0}'. Probing details: -{1} - - - The PDB for '{0}' was found and loaded. Probing details: -{1} - - - '{0}' is a managed binary compiled with an insecure (SHA-1) source code hashing algorithm. SHA-1 is subject to collision attacks and its use can compromise supply chain integrity. Pass '-checksumalgorithm:SHA256' on the csc.exe command-line or populate the project <ChecksumAlgorithm> property with 'SHA256' to enable secure source code hashing. - - - '{0}' is a {1} binary which was compiled with a secure (SHA-256) source code hashing algorithm. - - - '{0}' is a native binary that links one or more static libraries that include object files which were hashed using an insecure checksum algorithm (MD5). MD5 is subject to collision attacks and its use can compromise supply chain integrity. Pass '/ZH:SHA_256' on the cl.exe command-line to enable secure source code hashing. The following modules are out of policy: -{1} - - - Compilers can generate and store checksums of source files in order to provide linkage between binaries, their PDBs, and associated source code. This information is typically used to resolve source file when debugging but it can also be used to verify that a specific body of source code is, in fact, the code that was used to produce a specific set of binaries and PDBs. This validation is helpful in verifying supply chain integrity. Due to this security focus, it is important that the hashing algorithm used to produce checksums is secure. Legacy hashing algorithms, such as MD5 and SHA-1, have been demonstrated to be broken by modern hardware (that is, it is computationally feasible to force hash collisions, in which a common hash is generated from distinct files). Using a secure hashing algorithm, such as SHA-256, prevents the possibility of collision attacks, in which the checksum of a malicious file is used to produce a hash that satisfies the system that it is, in fact, the original file processed by the compiler. For managed binaries, pass '-checksumalgorithm:SHA256' on the csc.exe command-line or populate the '<ChecksumAlgorithm>' project property with 'SHA256' to enable secure source code hashing. For native binaries, pass '/ZH:SHA_256' on the cl.exe command-line to enable secure source code hashing. - - - '{0}' is a native binary that directly compiles and links one or more object files which were hashed using an insecure checksum algorithm (MD5). MD5 is subject to collision attacks and its use can compromise supply chain integrity. Pass '/ZH:SHA_256' on the cl.exe command-line to enable secure source code hashing. The following modules are out of policy: -{1} - - - '{0}' is a managed assembly that was compiled with an outdated toolchain ({1}) that does not support security features (such as SHA256 PDB checksums and reproducible builds) that must be enabled by policy. To resolve this issue, compile with more recent tools ({2} or later). - - - '{0}' is a managed assembly that was compiled with toolchain ({1}) that supports all security features that must be enabled by policy. - - - This rule emits CSV data to the console for every compiler/language/version combination that's observed in any PDB-linked compiland. - - - '{0}' is using debugging dwarf version '{1}'. The dwarf version 5 contains more information and should be used. To enable the debugging version 5 use '-gdwarf-5'. - - - The version of the debugging dwarf format is '{0}' for the file '{1}' - - - This check ensures that debugging dwarf version used is 5. The dwarf version 5 contains more information and should be used. Use the compiler flags '-gdwarf-5' to enable this. - - - The Stack Clash Protection is missing from this binary, so the stack from '{0}' can clash/colide with another memory region. Ensure you are compiling with the compiler flags '-fstack-clash-protection' to address this. - - - This check ensures that stack clash protection is enabled. Each program running on a computer uses a special memory region called the stack. This memory region is special because it grows automatically when the program needs more stack memory. But if it grows too much and gets too close to another memory region, the program may confuse the stack with the other memory region. An attacker can exploit this confusion to overwrite the stack with the other memory region, or the other way around. Use the compiler flags '-fstack-clash-protection' to enable this. - - - The Stack Clash Protection was present, so '{0}' is protected. - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + '{0}' is a 64-bit image with a preferred base address below the 4GB boundary. Having a preferred base address below this boundary triggers a compatibility mode in Address Space Layout Randomization (ASLR) on recent versions of Windows that reduces the number of locations to which ASLR may relocate the binary. This reduces the effectiveness of ASLR at mitigating memory corruption vulnerabilities. To resolve this issue, either use the default preferred base address by removing any uses of /baseaddress from compiler command lines, or /BASE from linker command lines (recommended), or configure your program to start at a base address above 4GB when compiled for 64 bit platforms (by changing the constant passed to /baseaddress or /BASE). Note that if you choose to continue using a custom preferred base address, you will need to make this modification only for 64-bit builds, as base addresses above 4GB are not valid for 32-bit binaries. + + + 64-bit images should have a preferred base address above the 4GB boundary to prevent triggering an Address Space Layout Randomization (ASLR) compatibility mode that decreases security. ASLR compatibility mode reduces the number of locations to which ASLR may relocate the binary, reducing its effectiveness at mitigating memory corruption vulnerabilities. To resolve this issue, either use the default preferred base address by removing any uses of /baseaddress from compiler command lines, or /BASE from linker command lines (recommended), or configure your program to start at a base address above 4GB when compiled for 64 bit platforms (by changing the constant passed to /baseaddress or /BASE). Note that if you choose to continue using a custom preferred base address, you will need to make this modification only for 64-bit builds, as base addresses above 4GB are not valid for 32-bit binaries. + + + '{0}' is a 64-bit image with a base address that is >= 4 gigabytes, increasing the effectiveness of Address Space Layout Randomization (which helps prevent attackers from executing security-sensitive code in well-known locations). + + + Binaries should not take dependencies on code with known security vulnerabilities. + + + '{0}' was built with a version of {1} which is subject to the following issues: {2}. To resolve this, {3}. The source files that triggered this were: {4} + + + '{0}' does not incorporate any known vulnerable dependencies, as configured by current policy. + + + Do not ship obsolete libraries for which there are known security vulnerabilities. + + + '{0}' appears to be an obsolete library (version {1}) for which there are known security vulnerabilities. To resolve this issue, obtain a version of {0} that is newer than version {2}. If this binary is not in fact {0}, ignore this warning. + + + Version information for '{0}' could not be parsed. The binary therefore could not be verified not to be an obsolete binary that is known to be vulnerable to one or more security problems. + + + vulnerable binary name and version metadata + + + '{0}' is not known to be an obsolete binary that is vulnerable to one or more security problems. + + + Application code should be compiled with the most up-to-date tool sets possible to take advantage of the most current compile-time security features. Among other things, these features provide address space layout randomization, help prevent arbitrary code execution, and enable code generation that can help prevent speculative execution side-channel attacks. + + + '{0}' was compiled with one or more modules which were not built using minimum required tool versions (compiler version {1}). More recent toolchains contain mitigations that make it more difficult for an attacker to exploit vulnerabilities in programs they produce. To resolve this issue, compile and/or link your binary with more recent tools. If you are servicing a product where the tool chain cannot be modified (e.g. producing a hotfix for an already shipped version) ignore this warning. Modules built outside of policy: +{2} + + + built with {0} compiler version {1} (Front end version {2}) + + + All linked modules of '{0}' satisfy configured policy (observed compilers: {1}). + + + Binaries should be compiled with a warning level that enables all critical security-relevant checks. Enabling at least warning level 3 enables important static analysis in the compiler that can identify bugs with a potential to provoke memory corruption, information disclosure, or double-free vulnerabilities. To resolve this issue, compile at warning level 3 or higher by supplying /W3, /W4, or /Wall to the compiler, and resolve the warnings emitted. + + + '{0}' was compiled at too low a warning level (effective warning level {1} for one or more modules). Warning level 3 enables important static analysis in the compiler to flag bugs that can lead to memory corruption, information disclosure, or double-free vulnerabilities. To resolve this issue, compile at warning level 3 or higher by supplying /W3, /W4, or /Wall to the compiler, and resolve the warnings emitted. An example compiler command line triggering this check: {2} +Modules triggering this check: {3} + + + '{0}' contains code from an unknown language, preventing a comprehensive analysis of the compiler warning settings. The language could not be identified for the following modules: {1} + + + '{0}' disables compiler warning(s) which are required by policy. A compiler warning is typically required if it has a high likelihood of flagging memory corruption, information disclosure, or double-free vulnerabilities. To resolve this issue, enable the indicated warning(s) by removing /Wxxxx switches (where xxxx is a warning id indicated here) from your command line, and resolve any warnings subsequently raised during compilation. An example compiler command line triggering this check was: {1} +Modules triggering this check were: +{2} + + + '{0}' was compiled at a secure warning level ({1}) and does not include any modules that disable specific warnings that are required by policy. As a result, it is less likely that memory corruption, information disclosure, double-free and other security-related vulnerabilities exist in code. + + + Binaries should enable the compiler control guard feature (CFG) at build time to prevent attackers from redirecting execution to unexpected, unsafe locations. CFG analyzes and discovers all indirect-call instructions at compilation and link time. It also injects a check that precedes every indirect call in code that ensures the target is an expected, safe location. If that check fails at runtime, the operating system will close the program. + + + '{0}' does not enable the control flow guard (CFG) mitigation. To resolve this issue, pass /guard:cf on both the compiler and linker command lines. Binaries also require the /DYNAMICBASE linker option in order to enable CFG. + + + '{0}' is a kernel mode portable executable compiled for a version of Windows that does not support the control flow guard feature for kernel mode binaries. + + + '{0}' enables the control flow guard mitigation. As a result, the operating system will force an application to close if an attacker is able to redirect execution in the component to an unexpected location. + + + Binaries should linked as DYNAMICBASE to be eligible for relocation by Address Space Layout Randomization (ASLR). ASLR is an important mitigation that makes it more difficult for an attacker to exploit memory corruption vulnerabilities. Configure your tools to build with this feature enabled. For C and C++ binaries, add /DYNAMICBASE to your linker command line. For .NET applications, use a compiler shipping with Visual Studio 2008 or later. + + + '{0}' is not marked as DYNAMICBASE. This means that the binary is not eligible for relocation by Address Space Layout Randomization (ASLR). ASLR is an important mitigation that makes it more difficult for an attacker to exploit memory corruption vulnerabilities. To resolve this issue, configure your tools to build with this feature enabled. For C and C++ binaries, add /DYNAMICBASE to your linker command line. For .NET applications, use a compiler shipping with Visual Studio 2008 or later. + + + '{0}' is marked as DYNAMICBASE but relocation data has been stripped from the image, preventing address space layout randomization. + + + '{0}' is a Windows CE image but does not contain any relocation data, preventing Address Space Layout Randomization. + + + '{0}' is properly compiled to enable Address Space Layout Randomization, reducing an attacker's ability to exploit code in well-known locations. + + + PE sections should not be marked as both writable and executable. This condition makes it easier for an attacker to exploit memory corruption vulnerabilities, as it may provide an attacker executable location(s) to inject shellcode. Because the loader will always mark the imports section as writable, it is therefore important to mark this section as non-executable. To resolve this issue, ensure that your program does not mark the imports section executable. Look for uses of /SECTION or /MERGE on the linker command line, or #pragma segment in source code, which change the imports section to be executable, or which merge the ".rdata" segment into an executable section. + + + '{0}' has the imports section marked executable. Because the loader will always mark the imports section as writable, it is important to mark this section as non-executable, so that an attacker cannot place shellcode here. To resolve this issue, ensure that your program does not mark the imports section as executable. Look for uses of /SECTION or /MERGE on the linker command line, or #pragma segment in source code, which change the imports section to be executable, or which merge the ".rdata" segment into an executable section. + + + '{0}' does not have an imports section that is marked as executable, helping to prevent the exploitation of code vulnerabilities. + + + Binaries should be built with the stack protector buffer security feature (/GS) enabled to increase the difficulty of exploiting stack buffer overflow memory corruption vulnerabilities. To resolve this issue, ensure that all modules compiled into the binary are compiled with the stack protector enabled by supplying /GS on the Visual C++ compiler command line. + + + '{0}' is a C or C++ binary built with the stack protector buffer security feature disabled in one or more modules. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. To resolve this issue, ensure that your code is compiled with the stack protector enabled by supplying /GS on the Visual C++ compiler command line. The affected modules were: {1} + + + '{0}' contains code from an unknown language, preventing a comprehensive analysis of the stack protector buffer security features. The language could not be identified for the following modules: {1}. + + + '{0}' is a C or C++ binary built with the stack protector buffer security feature enabled for all modules, making it more difficult for an attacker to exploit stack buffer overflow memory corruption vulnerabilities. + + + Application code should not interfere with the stack protector. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. The stack protector relies on a random number, called the "security cookie", to detect these buffer overflows. This 'cookie' is statically linked with your binary from a Visual C++ library in the form of the symbol __security_cookie. On recent Windows versions, the loader looks for the statically linked value of this cookie, and initializes the cookie with a far better source of entropy -- the system's secure random number generator -- rather than the limited random number generator available early in the C runtime startup code. When this symbol is not the default value, the additional entropy is not injected by the operating system, reducing the effectiveness of the stack protector. To resolve this issue, ensure that your code does not reference or create a symbol named __security_cookie or __security_cookie_complement. + + + '{0}' is a C or C++ binary that interferes with the stack protector. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. The stack protector relies on a random number, called the "security cookie", to detect these buffer overflows. This 'cookie' is statically linked with your binary from a Visual C++ library in the form of the symbol __security_cookie. On recent Windows versions, the loader looks for the magic statically linked value of this cookie, and initializes the cookie with a far better source of entropy -- the system's secure random number generator -- rather than the limited random number generator available early in the C runtime startup code. When this symbol is not the default value, the additional entropy is not injected by the operating system, reducing the effectiveness of the stack protector. To resolve this issue, ensure that your code does not reference or create a symbol named __security_cookie or __security_cookie_complement. NOTE: the modified cookie value detected was: {1} + + + '{0}' is a C or C++binary that enables the stack protection feature but the security cookie could not be located. The binary may be corrupted. + + + '{0}' is a C or C++ binary built with the buffer security feature that properly preserves the stack protecter cookie. This has the effect of enabling a significant increase in entropy provided by the operating system over that produced by the C runtime start-up code. + + + '{0}' is C or C++binary that does not contain a load config table, which indicates either that it was compiled and linked with a version of the compiler that precedes stack protection features or is a binary (such as an ngen'ed assembly) that is not subject to relevant security issues. + + + '{0}' appears to be a packed C or C++ binary that reports a security cookie offset that exceeds the size of the packed file. Use of the stack protector (/GS) feature therefore could not be verified. The file was possibly packed by: {1}. + + + '{0}' appears to be a packed C or C++ binary that reports a security cookie offset that exceeds the size of the packed file. Use of the stack protector (/GS) feature therefore could not be verified. The file was possibly packed by: {1}. + + + '{0}' is a C or C++ binary that does not initialize the stack protector. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. The stack protector requires access to entropy in order to be effective, which means a binary must initialize a random number generator at startup, by calling __security_init_cookie() as close to the binary's entry point as possible. Failing to do so will result in spurious buffer overflow detections on the part of the stack protector. To resolve this issue, use the default entry point provided by the C runtime, which will make this call for you, or call __security_init_cookie() manually in your custom entry point. + + + Binaries should properly initialize the stack protector (/GS) in order to increase the difficulty of exploiting stack buffer overflow memory corruption vulnerabilities. The stack protector requires access to entropy in order to be effective, which means a binary must initialize a random number generator at startup, by calling __security_init_cookie() as close to the binary's entry point as possible. Failing to do so will result in spurious buffer overflow detections on the part of the stack protector. To resolve this issue, use the default entry point provided by the C runtime, which will make this call for you, or call __security_init_cookie() manually in your custom entry point. + + + '{0}' is a C or C++ binary that does not enable the stack protection buffer security feature. It is therefore not required to initialize the stack protector. + + + '{0}' is a C or C++ binary built with the buffer security feature that properly initializes the stack protecter. This has the effect of increasing the effectiveness of the feature and reducing spurious detections. + + + '{0}' is a C or C++ binary that is not required to initialize the stack protection, as it does not contain executable code. + + + Application code should not disable stack protection for individual functions. The stack protector (/GS) is a security feature of the Windows native compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. Disabling the stack protector, even on a function-by-function basis, can compromise the security of code. To resolve this issue, remove occurrences of __declspec(safebuffers) from your code. If the additional code inserted by the stack protector has been shown in profiling to cause a significant performance problem for your application, attempt to move stack buffer modifications out of the hot path of execution to allow the compiler to avoid inserting stack protector checks in these locations rather than disabling the stack protector altogether. + + + '{0}' is a C or C++ binary built with function(s) ({1}) that disable the stack protector. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. Disabling the stack protector, even on a function-by-function basis, is disallowed by SDL policy. To resolve this issue, remove occurrences of __declspec(safebuffers) from your code. If the additional code inserted by the stack protector has been shown in profiling to cause a significant performance problem for your application, attempt to move stack buffer modifications out of the hot path of execution to allow the compiler to avoid inserting stack protector checks in these locations rather than disabling the stack protector altogether. + + + '{0}' is a C or C++ binary built with the stack protector buffer security feature enabled which does not disable protection for any individual functions (via __declspec(safebuffers), making it more difficult for an attacker to exploit stack buffer overflow memory corruption vulnerabilities. + + + Binaries should be marked as high entropy Address Space Layout Randomization (ASLR) compatible. High entropy allows ASLR to be more effective in mitigating memory corruption vulnerabilities. To resolve this issue, configure your tool chain to mark the program high entropy compatible; e.g. by supplying /HIGHENTROPYVA to the C or C++ linker command line. Binaries must also be compiled as /LARGEADDRESSAWARE in order to enable high entropy ASLR. + + + '{0}' does not declare itself as high entropy ASLR compatible. High entropy makes Address Space Layout Randomization more effective in mitigating memory corruption vulnerabilities. To resolve this issue, configure your tools to mark the program high entropy compatible; e.g. by supplying /HIGHENTROPYVA as well as /LARGEADDRESSAWARE to the C or C++ linker command line. + + + '{0}' does not declare itself as high entropy ASLR compatible. High entropy makes Address Space Layout Randomization more effective in mitigating memory corruption vulnerabilities. To resolve this issue, configure your tools to mark the program high entropy compatible; e.g. by supplying /HIGHENTROPYVA to the C or C++ linker command line. (This image was determined to have been properly compiled as /LARGEADDRESSAWARE.) + + + '{0}' does not declare itself as high entropy ASLR compatible. High entropy makes Address Space Layout Randomization more effective in mitigating memory corruption vulnerabilities. To resolve this issue, configure your tools to mark the program high entropy compatible by supplying /LARGEADDRESSAWARE to the C or C++ linker command line. (This image was determined to have been properly compiled as /HIGHENTROPYVA.) + + + '{0}' is high entropy ASLR compatible, reducing an attacker's ability to exploit code in well-known locations. + + + '{0}' is not marked NX compatible. The NXCompat bit, also known as "Data Execution Prevention" (DEP) or "Execute Disable" (XD), is a processor feature that allows a program to mark a piece of memory as non-executable. This helps mitigate memory corruption vulnerabilities by preventing an attacker from supplying direct shellcode in their exploit, because the exploit comes in the form of input data to the exploited program on a data segment, rather than on an executable code segment. To resolve this issue, ensure that your tools are configured to mark your binaries as NX compatible, e.g. by passing /NXCOMPAT to the C/C++ linker. + + + Binaries should be marked as NX compatible to help prevent execution of untrusted data as code. The NXCompat bit, also known as "Data Execution Prevention" (DEP) or "Execute Disable" (XD), triggers a processor security feature that allows a program to mark a piece of memory as non-executable. This helps mitigate memory corruption vulnerabilities by preventing an attacker from supplying direct shellcode in their exploit (because the exploit comes in the form of input data to the exploited program on a data segment, rather than on an executable code segment). Ensure that your tools are configured to mark your binaries as NX compatible, e.g. by passing /NXCOMPAT to the C/C++ linker. + + + '{0}' is marked as NX compatible, helping to prevent attackers from executing code that is injected into data segments. + + + X86 binaries should enable the SafeSEH mitigation to minimize exploitable memory corruption issues. SafeSEH makes it more difficult to exploit vulnerabilities that permit overwriting SEH control blocks on the stack, by verifying that the location to which a thrown SEH exception would jump is indeed defined as an exception handler in the source program (and not shellcode). To resolve this issue, supply the /SafeSEH flag on the linker command line. Note that you will need to configure your build system to supply this flag for x86 builds only, as the /SafeSEH flag is invalid when linking for ARM and x64. + + + '{0}' is an x86 binary which {1}, indicating that it does not enable the SafeSEH mitigation. SafeSEH makes it more difficult to exploit memory corruption vulnerabilities that can overwrite SEH control blocks on the stack, by verifying that the location to which a thrown SEH exception would jump is indeed defined as an exception handler in the source program (and not shellcode). To resolve this issue, supply the /SafeSEH flag on the linker command line. Note that you will need to configure your build system to supply this flag for x86 builds only, as the /SafeSEH flag is invalid when linking for ARM and x64. + + + has an empty SE handler table in the load configuration table + + + contains an unexpectedly small load configuration table {size 0} + + + does not contain a load configuration table + + + has zero SE handlers in the load configuration table + + + '{0}' is an x86 binary that enables SafeSEH, a mitigation that verifies SEH exception jump targets are defined as exception handlers in the program (and not shellcode). + + + '{0}' is an x86 binary that does not use SEH, making it an invalid target for exploits that attempt to replace SEH jump targets with attacker-controlled shellcode. + + + Code or data sections should not be marked as both shared and writable. Because these sections are shared across processes, this condition might permit a process with low privilege to alter memory in a higher privilege process. If you do not actually require that a section be both writable and shared, remove one or both of these attributes (by modifying your .DEF file, the appropriate linker /section switch arguments, etc.). If you must share common data across processes (for inter-process communication (IPC) or other purposes) use CreateFileMapping with proper security attributes or an actual IPC mechanism instead (COM, named pipes, LPC, etc.). + + + '{0}' contains one or more code or data sections ({1}) which are marked as both shared and writable. Because these sections are shared across processes, this condition might permit a process with low privilege to alter memory in a higher privilege process. If you do not actually require that a section be both writable and shared, remove one or both of these attributes (by modifying your .DEF file, the appropriate linker /section switch arguments, etc.). If you must share common data across processes (for inter-process communication (IPC) or other purposes) use CreateFileMapping with proper security attributes or an actual IPC mechanism instead (COM, named pipes, LPC, etc.). + + + '{0}' contains no data or code sections marked as both shared and writable, helping to prevent the exploitation of code vulnerabilities. + + + PE sections should not be marked as both writable and executable. This condition makes it easier for an attacker to exploit memory corruption vulnerabilities, as it may provide an attacker executable location(s) to inject shellcode. To resolve this issue, configure your tools to not emit memory sections that are writable and executable. For example, look for uses of /SECTION on the linker command line for C and C++ programs, or #pragma section in C and C++ source code, which mark a section with both attributes. Be sure to disable incremental linking in release builds, as this feature creates a writable and executable section named '.textbss' in order to function. + + + '{0}' contains PE section(s) ({1}) that are both writable and executable. Writable and executable memory segments make it easier for an attacker to exploit memory corruption vulnerabilities, because it may provide an attacker executable location(s) to inject shellcode. To resolve this issue, configure your tools to not emit memory sections that are writable and executable. For example, look for uses of /SECTION on the linker command line for C and C++ programs, or #pragma section in C and C++ source code, which mark a section with both attributes. Enabling incremental linking via the /INCREMENTAL argument (the default for Microsoft Visual Studio debug build) can also result in a writable and executable section named 'textbss'. For this case, disable incremental linking (or analyze an alternate build configuration that disables this feature) to resolve the problem. + + + '{0}' has a section alignment ({1}) that is smaller than its page size ({2}). + + + '{0}' contains no data or code sections marked as both shared and executable, helping to prevent the exploitation of code vulnerabilities. + + + '{0}' was signed exclusively with algorithms that WinTrustVerify has flagged as insecure. {1} + + + '{0}' signing was flagged as insecure by WinTrustVerify with error code '{1}' ({2}) + + + '{0}' signing could not be completely verified because '{1}' failed with error code: '{2}'. + + + '{0}' appears to be signed with secure cryptographic algorithms. WinTrustVerify successfully validated the binary but did not attempt to validate certificate chaining or that the root certificate is trusted. The following digitial signature algorithms were detected: {1} + + + Images should be correctly signed by trusted publishers using cryptographically secure signature algorithms. This rule invokes WinTrustVerify to validate that binary hash, signing and public key algorithms are secure and, where configurable, that key sizes meet acceptable size thresholds. + + + Application code should be compiled with the Spectre mitigations switch (/Qspectre) and toolsets that support it. + + + '{0}' was compiled with one or more modules that do not enable code generation mitigations for speculative execution side-channel attack (Spectre) vulnerabilities. Spectre attacks can compromise hardware-based isolation, allowing non-privileged users to retrieve potentially sensitive data from the CPU cache. To resolve the issue, provide the /Qspectre switch on the compiler command-line (or /d2guardspecload in cases where your compiler supports this switch and it is not possible to update to a toolset that supports /Qspectre). This warning should be addressed for code that operates on data that crosses a trust boundary and that can affect execution, such as parsing untrusted file inputs or processing query strings of a web request. +{1} + + + The following MASM modules were detected. The MASM compiler does not currently mitigate against speculative execution attacks: +{0} + + + The following modules were compiled with optimizations disabled (/Od), a condition that disables Spectre mitigations: +{0} + + + The following modules were compiled with Spectre mitigations explicitly disabled: +{0} + + + The following modules were compiled with a toolset that supports /Qspectre but the switch was not enabled on the command-line: +{0} + + + The MitigatedCompilers configuration entry was incorrect, either because version numbers overlapped or because a starting version number was higher than an ending version number. + + + All linked modules '{0}' were compiled with mitigations enabled that help prevent Spectre (speculative execution side-channel attack) vulnerabilities. + + + The following modules were compiled with a toolset that supports /Qspectre but the deprecated /d2guardspecload argument was specified on the command-line instead: {0} + + + A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc. + + + PIE disabled on executable '{0}'. This means the code section will always be loaded to the same address, even if ASLR is enabled in the Linux kernel. To address this, ensure you are compiling with '-fpie' when using clang/gcc. + + + PIE enabled on executable '{0}'. + + + '{0}' is a shared object library rather than an executable, and is automatically position independent. + + + This checks if a binary has an executable stack; an executable stack allows attackers to redirect code flow into stack memory, which is an easy place for an attacker to store shellcode. Ensure you are compiling with '-z noexecstack' to mark the stack as non-executable. + + + GNU_STACK segment on '{0}' is missing, which means the stack will likely be loaded as executable. Ensure you are using an up to date compiler and passing '-z noexecstack' to the compiler. + + + Stack on '{0}' is executable, which means that an attacker could use it as a place to store attack shellcode. Ensure you are compiling with '-z noexecstack' to mark the stack as non-executable. + + + GNU_STACK segment marked as non-executable on '{0}'. + + + The stack protector ensures that all functions that use buffers over a certain size will use a stack cookie (and check it) to prevent stack based buffer overflows, exiting if stack smashing is detected. Use '--fstack-protector-strong' (all buffers of 4 bytes or more) or '--fstack-protector-all' (all functions) to enable this. + + + The stack protector was not found in '{0}'. This may be because the binary has no stack-based arrays, or because '--stack-protector-strong' was not used. + + + Stack protector was found on '{0}'. However, if you are not compiling with '--stack-protector-strong', it may provide additional protections. + + + This check ensures that some relocation data is marked as read only after the executable is loaded, and moved below the '.data' section in memory. This prevents them from being overwritten, which can redirect control flow. Use the compiler flags '-Wl,z,relro' to enable this. + + + The GNU_RELRO segment is missing from this binary, so relocation sections in '{0}' will not be marked as read only after the binary is loaded. An attacker can overwrite these to redirect control flow. Ensure you are compiling with the compiler flags '-Wl,z,relro' to address this. + + + The GNU_RELRO segment was present, so '{0}' is protected. + + + This check ensures that some relocation data is marked as read only after the executable is loaded, and moved below the '.data' section in memory. This prevents them from being overwritten, which can redirect control flow. Use the compiler flags '-Wl,z,now' to enable this. + + + The BIND_NOW flag is missing from this binary, so relocation sections in '{0}' will not be marked as read only after the binary is loaded. An attacker can overwrite these to redirect control flow. Ensure you are compiling with the compiler flags '-Wl,z,now' to address this. + + + The BIND_NOW flag was present, so '{0}' is protected. + + + No checked functions are present/used when compiling '{0}', and it was compiled with GCC--and it uses functions that can be checked. The Fortify Source flag replaces some unsafe functions with checked versions when a static length can be determined, and can be enabled by passing '-D_FORTIFY_SOURCE=2' when optimization level 2 ('-O2') is enabled. It is possible that the flag was passed, but that the compiler could not statically determine the length of any buffers/strings. + + + All functions that can be checked in '{0}' are using the checked versions, so this binary is protected from overflows caused by those function's use. + + + No unsafe functions which can be replaced with checked versions are used in '{0}'. + + + Some checked functions were found in '{0}'; however, there were also some unchecked functions, which can occur when the compiler cannot statically determine the length of a buffer/string. We recommend reviewing your usage of functions like memcpy or strcpy. + + + GCC can automatically replace unsafe functions with checked variants when it can statically determine the length of a buffer or string. In the case of an overflow, the checked version will safely exit the program (rather than potentially allowing an exploit). This feature can be enabled by passing '-DFortify_Source=2' when optimization level 2 is enabled ('-O2'). + + + '{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}. + + + This check is not supported on the '{0}' platform, as it requires interoperability with a native Windows library. + + + '{0}' was not evaluated for check '{1}' because its PDB could not be loaded ({2}). + + + Could not locate the PDB for '{0}'. Probing details: +{1} + + + The PDB for '{0}' was found and loaded. Probing details: +{1} + + + '{0}' is a managed binary compiled with an insecure (SHA-1) source code hashing algorithm. SHA-1 is subject to collision attacks and its use can compromise supply chain integrity. Pass '-checksumalgorithm:SHA256' on the csc.exe command-line or populate the project <ChecksumAlgorithm> property with 'SHA256' to enable secure source code hashing. + + + '{0}' is a {1} binary which was compiled with a secure (SHA-256) source code hashing algorithm. + + + '{0}' is a native binary that links one or more static libraries that include object files which were hashed using an insecure checksum algorithm (MD5). MD5 is subject to collision attacks and its use can compromise supply chain integrity. Pass '/ZH:SHA_256' on the cl.exe command-line to enable secure source code hashing. The following modules are out of policy: +{1} + + + Compilers can generate and store checksums of source files in order to provide linkage between binaries, their PDBs, and associated source code. This information is typically used to resolve source file when debugging but it can also be used to verify that a specific body of source code is, in fact, the code that was used to produce a specific set of binaries and PDBs. This validation is helpful in verifying supply chain integrity. Due to this security focus, it is important that the hashing algorithm used to produce checksums is secure. Legacy hashing algorithms, such as MD5 and SHA-1, have been demonstrated to be broken by modern hardware (that is, it is computationally feasible to force hash collisions, in which a common hash is generated from distinct files). Using a secure hashing algorithm, such as SHA-256, prevents the possibility of collision attacks, in which the checksum of a malicious file is used to produce a hash that satisfies the system that it is, in fact, the original file processed by the compiler. For managed binaries, pass '-checksumalgorithm:SHA256' on the csc.exe command-line or populate the '<ChecksumAlgorithm>' project property with 'SHA256' to enable secure source code hashing. For native binaries, pass '/ZH:SHA_256' on the cl.exe command-line to enable secure source code hashing. + + + '{0}' is a native binary that directly compiles and links one or more object files which were hashed using an insecure checksum algorithm (MD5). MD5 is subject to collision attacks and its use can compromise supply chain integrity. Pass '/ZH:SHA_256' on the cl.exe command-line to enable secure source code hashing. The following modules are out of policy: +{1} + + + '{0}' is a managed assembly that was compiled with an outdated toolchain ({1}) that does not support security features (such as SHA256 PDB checksums and reproducible builds) that must be enabled by policy. To resolve this issue, compile with more recent tools ({2} or later). + + + '{0}' is a managed assembly that was compiled with toolchain ({1}) that supports all security features that must be enabled by policy. + + + This rule emits CSV data to the console for every compiler/language/version combination that's observed in any PDB-linked compiland. + + + Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks. + + + '{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines. + + + '{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. + + + '{0}' is using debugging dwarf version '{1}'. The dwarf version 5 contains more information and should be used. To enable the debugging version 5 use '-gdwarf-5'. + + + The version of the debugging dwarf format is '{0}' for the file '{1}' + + + This check ensures that debugging dwarf version used is 5. The dwarf version 5 contains more information and should be used. Use the compiler flags '-gdwarf-5' to enable this. + + + The Stack Clash Protection is missing from this binary, so the stack from '{0}' can clash/colide with another memory region. Ensure you are compiling with the compiler flags '-fstack-clash-protection' to address this. + + + This check ensures that stack clash protection is enabled. Each program running on a computer uses a special memory region called the stack. This memory region is special because it grows automatically when the program needs more stack memory. But if it grows too much and gets too close to another memory region, the program may confuse the stack with the other memory region. An attacker can exploit this confusion to overwrite the stack with the other memory region, or the other way around. Use the compiler flags '-fstack-clash-protection' to enable this. + + + The Stack Clash Protection was present, so '{0}' is protected. + \ No newline at end of file diff --git a/src/BinaryParsers/PEBinary/PortableExecutable/PE.cs b/src/BinaryParsers/PEBinary/PortableExecutable/PE.cs index e58aef0e3..a194e0223 100644 --- a/src/BinaryParsers/PEBinary/PortableExecutable/PE.cs +++ b/src/BinaryParsers/PEBinary/PortableExecutable/PE.cs @@ -804,6 +804,11 @@ public bool IsWixBinary } } + public PEMemoryBlock GetSectionData(int dataRelativeVirtualAddress) + { + return peReader.GetSectionData(dataRelativeVirtualAddress); + } + public ChecksumAlgorithmType ManagedPdbSourceFileChecksumAlgorithm(PdbFileType pdbFileType) { return pdbFileType == PdbFileType.Windows diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/BinSkim.win-x64.ni.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/BinSkim.win-x64.ni.dll.sarif index 4f8f95e42..10a16f476 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/BinSkim.win-x64.ni.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/BinSkim.win-x64.ni.dll.sarif @@ -293,10 +293,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 12, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "BinSkim.win-x64.ni.dll", + "EnableShadowStack", + "image is a managed IL library (i.e., ahead of time compiled) assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/BinSkim.win-x64.ni.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 13, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -318,7 +342,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA2001", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -508,7 +532,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -530,7 +554,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -552,7 +576,7 @@ }, { "ruleId": "BA2010", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -574,7 +598,7 @@ }, { "ruleId": "BA2012", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -596,7 +620,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -618,7 +642,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -640,7 +664,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1007,14 +1031,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/BinSkim.win-x86.ni.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/BinSkim.win-x86.ni.dll.sarif index 6e4bcda47..3ca4f3c9d 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/BinSkim.win-x86.ni.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/BinSkim.win-x86.ni.dll.sarif @@ -269,10 +269,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 11, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "BinSkim.win-x86.ni.dll", + "EnableShadowStack", + "image is a managed IL library (i.e., ahead of time compiled) assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/BinSkim.win-x86.ni.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 12, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -294,7 +318,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 12, + "ruleIndex": 13, "kind": "notApplicable", "level": "none", "message": { @@ -318,7 +342,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "pass", "level": "none", "message": { @@ -484,7 +508,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -506,7 +530,7 @@ }, { "ruleId": "BA2010", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -528,7 +552,7 @@ }, { "ruleId": "BA2012", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -550,7 +574,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -572,7 +596,7 @@ }, { "ruleId": "BA2018", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -594,7 +618,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -616,7 +640,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -638,7 +662,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -977,14 +1001,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.linux-x64.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.linux-x64.dll.sarif index 2fd11558a..2a979ec8b 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.linux-x64.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.linux-x64.dll.sarif @@ -341,10 +341,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 14, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Binskim.linux-x64.dll", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Binskim.linux-x64.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 15, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -366,7 +390,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "notApplicable", "level": "none", "message": { @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -556,7 +580,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -578,7 +602,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -600,7 +624,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -622,7 +646,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "notApplicable", "level": "none", "message": { @@ -1045,14 +1069,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x64.RTR.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x64.RTR.dll.sarif index 459ccebe4..4a10b62c2 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x64.RTR.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x64.RTR.dll.sarif @@ -293,10 +293,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 12, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Binskim.win-x64.RTR.dll", + "EnableShadowStack", + "image is a managed IL library (i.e., ahead of time compiled) assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Binskim.win-x64.RTR.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 13, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -318,7 +342,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA2001", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -508,7 +532,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -530,7 +554,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -552,7 +576,7 @@ }, { "ruleId": "BA2010", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -574,7 +598,7 @@ }, { "ruleId": "BA2012", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -596,7 +620,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -618,7 +642,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -640,7 +664,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1007,14 +1031,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x64.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x64.dll.sarif index d7fcdba94..7dd66678b 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x64.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x64.dll.sarif @@ -341,10 +341,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 14, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Binskim.win-x64.dll", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Binskim.win-x64.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 15, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -366,7 +390,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "notApplicable", "level": "none", "message": { @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -556,7 +580,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -578,7 +602,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -600,7 +624,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -622,7 +646,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "notApplicable", "level": "none", "message": { @@ -1045,14 +1069,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x86.RTR.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x86.RTR.dll.sarif index 0e87b94b5..c04c1ac1c 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x86.RTR.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x86.RTR.dll.sarif @@ -269,10 +269,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 11, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Binskim.win-x86.RTR.dll", + "EnableShadowStack", + "image is a managed IL library (i.e., ahead of time compiled) assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Binskim.win-x86.RTR.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 12, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -294,7 +318,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 12, + "ruleIndex": 13, "kind": "notApplicable", "level": "none", "message": { @@ -318,7 +342,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "pass", "level": "none", "message": { @@ -484,7 +508,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -506,7 +530,7 @@ }, { "ruleId": "BA2010", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -528,7 +552,7 @@ }, { "ruleId": "BA2012", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -550,7 +574,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -572,7 +596,7 @@ }, { "ruleId": "BA2018", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -594,7 +618,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -616,7 +640,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -638,7 +662,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -977,14 +1001,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x86.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x86.dll.sarif index dc3e4fb72..169f56f56 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x86.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Binskim.win-x86.dll.sarif @@ -293,10 +293,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 12, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Binskim.win-x86.dll", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Binskim.win-x86.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 13, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -318,7 +342,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -508,7 +532,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -530,7 +554,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -552,7 +576,7 @@ }, { "ruleId": "BA2018", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -574,7 +598,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -596,7 +620,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -618,7 +642,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "notApplicable", "level": "none", "message": { @@ -988,14 +1012,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_RTR_linux-x64_VS2019_Default.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_RTR_linux-x64_VS2019_Default.dll.sarif index e8d1fa776..7d786e099 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_RTR_linux-x64_VS2019_Default.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_RTR_linux-x64_VS2019_Default.dll.sarif @@ -341,10 +341,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 14, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "DotNetCore_RTR_linux-x64_VS2019_Default.dll", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/DotNetCore_RTR_linux-x64_VS2019_Default.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 15, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -366,7 +390,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "notApplicable", "level": "none", "message": { @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -557,7 +581,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -579,7 +603,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -601,7 +625,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -623,7 +647,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -645,7 +669,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1068,14 +1092,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_RTR_win-x64_VS2019_Default.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_RTR_win-x64_VS2019_Default.dll.sarif index 181b213a3..8956174a7 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_RTR_win-x64_VS2019_Default.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_RTR_win-x64_VS2019_Default.dll.sarif @@ -341,10 +341,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 14, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "DotNetCore_RTR_win-x64_VS2019_Default.dll", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/DotNetCore_RTR_win-x64_VS2019_Default.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 15, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -366,7 +390,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "notApplicable", "level": "none", "message": { @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -557,7 +581,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -579,7 +603,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -601,7 +625,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -623,7 +647,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -645,7 +669,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1068,14 +1092,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_RTR_win-x86_VS2019_Default.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_RTR_win-x86_VS2019_Default.dll.sarif index 111eb1d95..4718c9139 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_RTR_win-x86_VS2019_Default.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_RTR_win-x86_VS2019_Default.dll.sarif @@ -293,10 +293,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 12, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "DotNetCore_RTR_win-x86_VS2019_Default.dll", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/DotNetCore_RTR_win-x86_VS2019_Default.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 13, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -318,7 +342,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -509,7 +533,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -531,7 +555,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -553,7 +577,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -575,7 +599,7 @@ }, { "ruleId": "BA2018", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -597,7 +621,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -619,7 +643,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -641,7 +665,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1011,14 +1035,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_linux-x64_VS2019_Default.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_linux-x64_VS2019_Default.dll.sarif index aa3d18290..38951617c 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_linux-x64_VS2019_Default.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_linux-x64_VS2019_Default.dll.sarif @@ -341,10 +341,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 14, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "DotNetCore_linux-x64_VS2019_Default.dll", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/DotNetCore_linux-x64_VS2019_Default.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 15, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -366,7 +390,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "notApplicable", "level": "none", "message": { @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -557,7 +581,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -579,7 +603,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -601,7 +625,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -623,7 +647,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -645,7 +669,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1068,14 +1092,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_win-x64_VS2019_Default.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_win-x64_VS2019_Default.dll.sarif index a491a5a6e..b0eddac11 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_win-x64_VS2019_Default.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_win-x64_VS2019_Default.dll.sarif @@ -341,10 +341,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 14, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "DotNetCore_win-x64_VS2019_Default.dll", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/DotNetCore_win-x64_VS2019_Default.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 15, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -366,7 +390,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "notApplicable", "level": "none", "message": { @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -557,7 +581,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -579,7 +603,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -601,7 +625,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -623,7 +647,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -645,7 +669,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1068,14 +1092,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_win-x64_VS2019_Default.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_win-x64_VS2019_Default.exe.sarif index afd6f5092..e984d664e 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_win-x64_VS2019_Default.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_win-x64_VS2019_Default.exe.sarif @@ -245,10 +245,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 10, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "DotNetCore_win-x64_VS2019_Default.exe", + "EnableShadowStack", + "image is a .NET core native bootstrap exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/DotNetCore_win-x64_VS2019_Default.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 11, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -270,7 +294,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 11, + "ruleIndex": 12, "kind": "notApplicable", "level": "none", "message": { @@ -294,7 +318,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 12, + "ruleIndex": 13, "kind": "notApplicable", "level": "none", "message": { @@ -318,7 +342,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA2001", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "pass", "level": "none", "message": { @@ -460,7 +484,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "pass", "level": "none", "message": { @@ -482,7 +506,7 @@ }, { "ruleId": "BA2008", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -504,7 +528,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -526,7 +550,7 @@ }, { "ruleId": "BA2010", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -548,7 +572,7 @@ }, { "ruleId": "BA2012", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -570,7 +594,7 @@ }, { "ruleId": "BA2015", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -592,7 +616,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -614,7 +638,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -636,7 +660,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -944,14 +968,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_win-x86_VS2019_Default.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_win-x86_VS2019_Default.dll.sarif index b3cf51214..b9cd1f5a1 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_win-x86_VS2019_Default.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/DotNetCore_win-x86_VS2019_Default.dll.sarif @@ -293,10 +293,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 12, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "DotNetCore_win-x86_VS2019_Default.dll", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/DotNetCore_win-x86_VS2019_Default.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 13, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -318,7 +342,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -509,7 +533,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -531,7 +555,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -553,7 +577,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -575,7 +599,7 @@ }, { "ruleId": "BA2018", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -597,7 +621,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -619,7 +643,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -641,7 +665,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1011,14 +1035,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/ManagedInteropAssemblyForAtlTestLibrary.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/ManagedInteropAssemblyForAtlTestLibrary.dll.sarif index d83ebb711..5449476ef 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/ManagedInteropAssemblyForAtlTestLibrary.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/ManagedInteropAssemblyForAtlTestLibrary.dll.sarif @@ -293,10 +293,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 12, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "ManagedInteropAssemblyForAtlTestLibrary.dll", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/ManagedInteropAssemblyForAtlTestLibrary.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 13, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -318,7 +342,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -508,7 +532,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -530,7 +554,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -552,7 +576,7 @@ }, { "ruleId": "BA2018", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -574,7 +598,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -596,7 +620,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -618,7 +642,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "notApplicable", "level": "none", "message": { @@ -988,14 +1012,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/ManagedResourcesOnly.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/ManagedResourcesOnly.dll.sarif index b4ab5be05..6ce5f480f 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/ManagedResourcesOnly.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/ManagedResourcesOnly.dll.sarif @@ -341,10 +341,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 14, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "ManagedResourcesOnly.dll", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/ManagedResourcesOnly.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 15, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -366,7 +390,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "notApplicable", "level": "none", "message": { @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -556,7 +580,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -578,7 +602,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -600,7 +624,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -622,7 +646,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -1044,14 +1068,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_AnyCPU_VS2017_NoPrefer32Bit.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_AnyCPU_VS2017_NoPrefer32Bit.exe.sarif index c43a766ca..75dc941ba 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_AnyCPU_VS2017_NoPrefer32Bit.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_AnyCPU_VS2017_NoPrefer32Bit.exe.sarif @@ -269,10 +269,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 11, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Managed_AnyCPU_VS2017_NoPrefer32Bit.exe", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Managed_AnyCPU_VS2017_NoPrefer32Bit.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 12, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -294,7 +318,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 12, + "ruleIndex": 13, "kind": "notApplicable", "level": "none", "message": { @@ -318,7 +342,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 19, + "ruleIndex": 20, "message": { "id": "Error_Managed", "arguments": [ @@ -482,7 +506,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -504,7 +528,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -526,7 +550,7 @@ }, { "ruleId": "BA2015", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error_NoHighEntropyVA", @@ -547,7 +571,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -569,7 +593,7 @@ }, { "ruleId": "BA2018", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -591,7 +615,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -613,7 +637,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -635,7 +659,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -974,14 +998,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_AnyCPU_VS2017_Prefer32Bit.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_AnyCPU_VS2017_Prefer32Bit.exe.sarif index 62b555436..3ce0130f9 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_AnyCPU_VS2017_Prefer32Bit.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_AnyCPU_VS2017_Prefer32Bit.exe.sarif @@ -293,10 +293,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 12, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Managed_AnyCPU_VS2017_Prefer32Bit.exe", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Managed_AnyCPU_VS2017_Prefer32Bit.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 13, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -318,7 +342,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 20, + "ruleIndex": 21, "message": { "id": "Error_Managed", "arguments": [ @@ -506,7 +530,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -528,7 +552,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -550,7 +574,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -572,7 +596,7 @@ }, { "ruleId": "BA2018", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -594,7 +618,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -616,7 +640,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -638,7 +662,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1008,14 +1032,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_x64_VS2015_FSharp.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_x64_VS2015_FSharp.exe.sarif index 16eb360c9..d1811d71d 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_x64_VS2015_FSharp.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_x64_VS2015_FSharp.exe.sarif @@ -317,10 +317,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 13, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Managed_x64_VS2015_FSharp.exe", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Managed_x64_VS2015_FSharp.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 14, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -342,7 +366,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "notApplicable", "level": "none", "message": { @@ -510,7 +534,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 21, + "ruleIndex": 22, "message": { "id": "Error_Managed", "arguments": [ @@ -530,7 +554,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -552,7 +576,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -574,7 +598,7 @@ }, { "ruleId": "BA2015", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -596,7 +620,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -618,7 +642,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -640,7 +664,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1032,14 +1056,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_x86_VS2013_Wpf.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_x86_VS2013_Wpf.exe.sarif index 7d648d323..996e4449e 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_x86_VS2013_Wpf.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_x86_VS2013_Wpf.exe.sarif @@ -293,10 +293,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 12, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Managed_x86_VS2013_Wpf.exe", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Managed_x86_VS2013_Wpf.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 13, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -318,7 +342,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 20, + "ruleIndex": 21, "message": { "id": "Error_Managed", "arguments": [ @@ -506,7 +530,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -528,7 +552,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -550,7 +574,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -572,7 +596,7 @@ }, { "ruleId": "BA2018", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -594,7 +618,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -616,7 +640,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -638,7 +662,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1008,14 +1032,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_x86_VS2015_FSharp.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_x86_VS2015_FSharp.dll.sarif index 0f0915f16..31f1f382e 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_x86_VS2015_FSharp.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Managed_x86_VS2015_FSharp.dll.sarif @@ -293,10 +293,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 12, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Managed_x86_VS2015_FSharp.dll", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Managed_x86_VS2015_FSharp.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 13, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -318,7 +342,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 20, + "ruleIndex": 21, "message": { "id": "Error_Managed", "arguments": [ @@ -506,7 +530,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -528,7 +552,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -550,7 +574,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -572,7 +596,7 @@ }, { "ruleId": "BA2018", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -594,7 +618,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -616,7 +640,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -638,7 +662,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1008,14 +1032,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x64_VS2013_Default.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x64_VS2013_Default.dll.sarif index 1dfcdf9a1..f6c1c8074 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x64_VS2013_Default.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x64_VS2013_Default.dll.sarif @@ -668,6 +668,26 @@ } } ] + }, + { + "ruleId": "BA2025", + "ruleIndex": 28, + "message": { + "id": "Warning", + "arguments": [ + "MixedMode_x64_VS2013_Default.dll" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/MixedMode_x64_VS2013_Default.dll", + "index": 0 + } + } + } + ] } ], "tool": { @@ -790,11 +810,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1425,6 +1445,28 @@ } }, "name": "EnableSpectreMitigations" + }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" } ], "properties": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x64_VS2013_NoPdb.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x64_VS2013_NoPdb.exe.sarif index 71a35b4c8..77e28d9aa 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x64_VS2013_NoPdb.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x64_VS2013_NoPdb.exe.sarif @@ -558,11 +558,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1174,6 +1174,27 @@ "associatedRule": { "id": "BA2024" } + }, + { + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/MixedMode_x64_VS2013_NoPdb.exe" + } + } + } + ], + "message": { + "text": "'MixedMode_x64_VS2013_NoPdb.exe' was not evaluated for check 'EnableShadowStack' because its PDB could not be loaded (E_PDB_NOT_FOUND)." + }, + "level": "error", + "descriptor": { + "id": "ERR997.ExceptionLoadingPdb" + }, + "associatedRule": { + "id": "BA2025" + } } ], "executionSuccessful": false diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x64_VS2015_Default.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x64_VS2015_Default.exe.sarif index 44366bdbb..b6ecb02b5 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x64_VS2015_Default.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x64_VS2015_Default.exe.sarif @@ -666,6 +666,26 @@ } } ] + }, + { + "ruleId": "BA2025", + "ruleIndex": 28, + "message": { + "id": "Warning", + "arguments": [ + "MixedMode_x64_VS2015_Default.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/MixedMode_x64_VS2015_Default.exe", + "index": 0 + } + } + } + ] } ], "tool": { @@ -757,11 +777,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1423,6 +1443,28 @@ } }, "name": "EnableSpectreMitigations" + }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" } ], "properties": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x86_VS2013_Default.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x86_VS2013_Default.exe.sarif index ae6e41417..f487693cf 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x86_VS2013_Default.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x86_VS2013_Default.exe.sarif @@ -663,6 +663,26 @@ } } ] + }, + { + "ruleId": "BA2025", + "ruleIndex": 28, + "message": { + "id": "Warning", + "arguments": [ + "MixedMode_x86_VS2013_Default.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/MixedMode_x86_VS2013_Default.exe", + "index": 0 + } + } + } + ] } ], "tool": { @@ -726,11 +746,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1420,6 +1440,28 @@ } }, "name": "EnableSpectreMitigations" + }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" } ], "properties": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x86_VS2013_MissingPdb.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x86_VS2013_MissingPdb.dll.sarif index 618a77112..cb44d8bad 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x86_VS2013_MissingPdb.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x86_VS2013_MissingPdb.dll.sarif @@ -561,11 +561,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1174,6 +1174,27 @@ "associatedRule": { "id": "BA2024" } + }, + { + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/MixedMode_x86_VS2013_MissingPdb.dll" + } + } + } + ], + "message": { + "text": "'MixedMode_x86_VS2013_MissingPdb.dll' was not evaluated for check 'EnableShadowStack' because its PDB could not be loaded (E_PDB_NOT_FOUND)." + }, + "level": "error", + "descriptor": { + "id": "ERR997.ExceptionLoadingPdb" + }, + "associatedRule": { + "id": "BA2025" + } } ], "executionSuccessful": false diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x86_VS2015_Default.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x86_VS2015_Default.exe.sarif index 9dc0871ac..26cb1a248 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x86_VS2015_Default.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/MixedMode_x86_VS2015_Default.exe.sarif @@ -663,6 +663,26 @@ } } ] + }, + { + "ruleId": "BA2025", + "ruleIndex": 28, + "message": { + "id": "Warning", + "arguments": [ + "MixedMode_x86_VS2015_Default.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/MixedMode_x86_VS2015_Default.exe", + "index": 0 + } + } + } + ] } ], "tool": { @@ -726,11 +746,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1420,6 +1440,28 @@ } }, "name": "EnableSpectreMitigations" + }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" } ], "properties": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_ARM_VS2015_CvtresResourceOnly.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_ARM_VS2015_CvtresResourceOnly.dll.sarif index 5f8588a34..cb2123ba6 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_ARM_VS2015_CvtresResourceOnly.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_ARM_VS2015_CvtresResourceOnly.dll.sarif @@ -317,10 +317,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 13, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_ARM_VS2015_CvtresResourceOnly.dll", + "EnableShadowStack", + "image is a resource-only binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_ARM_VS2015_CvtresResourceOnly.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 14, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -342,7 +366,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "notApplicable", "level": "none", "message": { @@ -510,7 +534,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -532,7 +556,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -554,7 +578,7 @@ }, { "ruleId": "BA2010", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -576,7 +600,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -598,7 +622,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -620,7 +644,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "notApplicable", "level": "none", "message": { @@ -1018,14 +1042,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_CETShadowStack_Enabled.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_CETShadowStack_Enabled.exe.sarif new file mode 100644 index 000000000..4a805ad65 --- /dev/null +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_CETShadowStack_Enabled.exe.sarif @@ -0,0 +1,1471 @@ +{ + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "version": "2.1.0", + "runs": [ + { + "results": [ + { + "ruleId": "BA2016", + "ruleIndex": 0, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "MarkImageAsNXCompatible", + "image is a 64-bit binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2018", + "ruleIndex": 1, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "EnableSafeSEH", + "image is not a 32-bit binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 2, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "EnablePositionIndependentExecutable", + "image is not an ELF binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3002", + "ruleIndex": 3, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "DoNotMarkStackAsExecutable", + "image is not an ELF binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3003", + "ruleIndex": 4, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "EnableStackProtector", + "image is not an ELF binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3004", + "ruleIndex": 5, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "GenerateRequiredSymbolFormat", + "image is not an ELF binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 6, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "EnableStackClashProtection", + "image is not an ELF binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3010", + "ruleIndex": 7, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "EnableReadOnlyRelocations", + "image is not an ELF binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3011", + "ruleIndex": 8, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "EnableBindNow", + "image is not an ELF binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3030", + "ruleIndex": 9, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "UseCheckedFunctionsWithGcc", + "image is not an ELF binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2001", + "ruleIndex": 10, + "kind": "pass", + "level": "none", + "message": { + "id": "Pass", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2002", + "ruleIndex": 11, + "kind": "pass", + "level": "none", + "message": { + "id": "Pass", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2004", + "ruleIndex": 12, + "message": { + "id": "Warning_NativeWithInsecureStaticLibraryCompilands", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "Microsoft (R) Optimizing Compiler : c : 19.28.29913.0 : MSVCRTD.lib (cpu_disp.obj,debugger_jmc.obj,dyn_tls_dtor.obj,dyn_tls_init.obj,gs_cookie.obj,gs_report.obj,gs_support.obj,guard_support.obj,loadcfg.obj,matherr_detection.obj,ucrt_detection.obj)\r\nMicrosoft (R) Optimizing Compiler : cxx : 19.28.29913.0 : MSVCRTD.lib (argv_mode.obj,commit_mode.obj,default_local_stdio_options.obj,denormal_control.obj,env_mode.obj,error.obj,exe_main.obj,file_mode.obj,gshandler.obj,gshandlereh4.obj,init.obj,initializers.obj,initsect.obj,invalid_parameter_handler.obj,matherr.obj,new_mode.obj,pdblkup.obj,stack.obj,thread_locale.obj,tncleanup.obj,ucrt_stubs.obj,userapi.obj,utility.obj,utility_desktop.obj)\r\n" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2005", + "ruleIndex": 13, + "kind": "pass", + "level": "none", + "message": { + "id": "Pass", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2006", + "ruleIndex": 14, + "kind": "pass", + "level": "none", + "message": { + "id": "Pass", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "Microsoft (R) Optimizing Compiler:C:19.28.29913.0, Microsoft (R) Optimizing Compiler:Cxx:19.28.29913.0" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2007", + "ruleIndex": 15, + "kind": "pass", + "level": "none", + "message": { + "id": "Pass", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "2147483647" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2008", + "ruleIndex": 16, + "level": "error", + "message": { + "id": "Error", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2009", + "ruleIndex": 17, + "kind": "pass", + "level": "none", + "message": { + "id": "Pass", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2010", + "ruleIndex": 18, + "kind": "pass", + "level": "none", + "message": { + "id": "Pass", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2011", + "ruleIndex": 19, + "kind": "pass", + "level": "none", + "message": { + "id": "Pass", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2012", + "ruleIndex": 20, + "kind": "pass", + "level": "none", + "message": { + "id": "Pass", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2013", + "ruleIndex": 21, + "kind": "pass", + "level": "none", + "message": { + "id": "Pass", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2014", + "ruleIndex": 22, + "kind": "pass", + "level": "none", + "message": { + "id": "Pass", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2015", + "ruleIndex": 23, + "kind": "pass", + "level": "none", + "message": { + "id": "Pass", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2019", + "ruleIndex": 24, + "kind": "pass", + "level": "none", + "message": { + "id": "Pass", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2021", + "ruleIndex": 25, + "level": "error", + "message": { + "id": "Error", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + ".textbss" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2022", + "ruleIndex": 26, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "SignSecurely", + "image is not signed " + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2024", + "ruleIndex": 27, + "message": { + "id": "Warning", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe", + "The following modules were compiled with a toolset that supports /Qspectre but the switch was not enabled on the command-line:\r\nMSVCRTD.lib,c,19.28.29913.0 (cpu_disp.obj,debugger_jmc.obj,dyn_tls_dtor.obj,dyn_tls_init.obj,gs_cookie.obj,gs_report.obj,gs_support.obj,guard_support.obj,loadcfg.obj,matherr_detection.obj,ucrt_detection.obj)\r\nMSVCRTD.lib,cxx,19.28.29913.0 (argv_mode.obj,commit_mode.obj,default_local_stdio_options.obj,denormal_control.obj,env_mode.obj,error.obj,exe_main.obj,file_mode.obj,gshandler.obj,gshandlereh4.obj,init.obj,initializers.obj,initsect.obj,invalid_parameter_handler.obj,matherr.obj,new_mode.obj,pdblkup.obj,stack.obj,thread_locale.obj,tncleanup.obj,ucrt_stubs.obj,userapi.obj,utility.obj,utility_desktop.obj)\r\n\r\n" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA2025", + "ruleIndex": 28, + "kind": "pass", + "level": "none", + "message": { + "id": "Pass", + "arguments": [ + "Native_x64_CETShadowStack_Enabled.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe", + "index": 0 + } + } + } + ] + } + ], + "tool": { + "driver": { + "name": "testhost", + "version": "15.0.0.0", + "rules": [ + { + "id": "BA2016", + "fullDescription": { + "text": "Binaries should be marked as NX compatible to help prevent execution of untrusted data as code. The NXCompat bit, also known as \"Data Execution Prevention\" (DEP) or \"Execute Disable\" (XD), triggers a processor security feature that allows a program to mark a piece of memory as non-executable. This helps mitigate memory corruption vulnerabilities by preventing an attacker from supplying direct shellcode in their exploit (because the exploit comes in the form of input data to the exploited program on a data segment, rather than on an executable code segment). Ensure that your tools are configured to mark your binaries as NX compatible, e.g. by passing /NXCOMPAT to the C/C++ linker." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2016MarkImageAsNXCompatible", + "help": { + "text": "Binaries should be marked as NX compatible to help prevent execution of untrusted data as code. The NXCompat bit, also known as \"Data Execution Prevention\" (DEP) or \"Execute Disable\" (XD), triggers a processor security feature that allows a program to mark a piece of memory as non-executable. This helps mitigate memory corruption vulnerabilities by preventing an attacker from supplying direct shellcode in their exploit (because the exploit comes in the form of input data to the exploited program on a data segment, rather than on an executable code segment). Ensure that your tools are configured to mark your binaries as NX compatible, e.g. by passing /NXCOMPAT to the C/C++ linker." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' is marked as NX compatible, helping to prevent attackers from executing code that is injected into data segments." + }, + "Error": { + "text": "'{0}' is not marked NX compatible. The NXCompat bit, also known as \"Data Execution Prevention\" (DEP) or \"Execute Disable\" (XD), is a processor feature that allows a program to mark a piece of memory as non-executable. This helps mitigate memory corruption vulnerabilities by preventing an attacker from supplying direct shellcode in their exploit, because the exploit comes in the form of input data to the exploited program on a data segment, rather than on an executable code segment. To resolve this issue, ensure that your tools are configured to mark your binaries as NX compatible, e.g. by passing /NXCOMPAT to the C/C++ linker." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "MarkImageAsNXCompatible", + "properties": { + "equivalentBinScopeRuleReadableName": "NXCheck" + } + }, + { + "id": "BA2018", + "fullDescription": { + "text": "X86 binaries should enable the SafeSEH mitigation to minimize exploitable memory corruption issues. SafeSEH makes it more difficult to exploit vulnerabilities that permit overwriting SEH control blocks on the stack, by verifying that the location to which a thrown SEH exception would jump is indeed defined as an exception handler in the source program (and not shellcode). To resolve this issue, supply the /SafeSEH flag on the linker command line. Note that you will need to configure your build system to supply this flag for x86 builds only, as the /SafeSEH flag is invalid when linking for ARM and x64." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2018EnableSafeSEH", + "help": { + "text": "X86 binaries should enable the SafeSEH mitigation to minimize exploitable memory corruption issues. SafeSEH makes it more difficult to exploit vulnerabilities that permit overwriting SEH control blocks on the stack, by verifying that the location to which a thrown SEH exception would jump is indeed defined as an exception handler in the source program (and not shellcode). To resolve this issue, supply the /SafeSEH flag on the linker command line. Note that you will need to configure your build system to supply this flag for x86 builds only, as the /SafeSEH flag is invalid when linking for ARM and x64." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' is an x86 binary that enables SafeSEH, a mitigation that verifies SEH exception jump targets are defined as exception handlers in the program (and not shellcode)." + }, + "Pass_NoSEH": { + "text": "'{0}' is an x86 binary that does not use SEH, making it an invalid target for exploits that attempt to replace SEH jump targets with attacker-controlled shellcode." + }, + "Error": { + "text": "'{0}' is an x86 binary which {1}, indicating that it does not enable the SafeSEH mitigation. SafeSEH makes it more difficult to exploit memory corruption vulnerabilities that can overwrite SEH control blocks on the stack, by verifying that the location to which a thrown SEH exception would jump is indeed defined as an exception handler in the source program (and not shellcode). To resolve this issue, supply the /SafeSEH flag on the linker command line. Note that you will need to configure your build system to supply this flag for x86 builds only, as the /SafeSEH flag is invalid when linking for ARM and x64." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableSafeSEH", + "properties": { + "equivalentBinScopeRuleReadableName": "SafeSEHCheck" + } + }, + { + "id": "BA3001", + "fullDescription": { + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", + "help": { + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + }, + "messageStrings": { + "Pass_Executable": { + "text": "PIE enabled on executable '{0}'." + }, + "Pass_Library": { + "text": "'{0}' is a shared object library rather than an executable, and is automatically position independent." + }, + "Error": { + "text": "PIE disabled on executable '{0}'. This means the code section will always be loaded to the same address, even if ASLR is enabled in the Linux kernel. To address this, ensure you are compiling with '-fpie' when using clang/gcc." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnablePositionIndependentExecutable" + }, + { + "id": "BA3002", + "fullDescription": { + "text": "This checks if a binary has an executable stack; an executable stack allows attackers to redirect code flow into stack memory, which is an easy place for an attacker to store shellcode. Ensure you are compiling with '-z noexecstack' to mark the stack as non-executable." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3002DoNotMarkStackAsExecutable", + "help": { + "text": "This checks if a binary has an executable stack; an executable stack allows attackers to redirect code flow into stack memory, which is an easy place for an attacker to store shellcode. Ensure you are compiling with '-z noexecstack' to mark the stack as non-executable." + }, + "messageStrings": { + "Pass": { + "text": "GNU_STACK segment marked as non-executable on '{0}'." + }, + "Error_StackExec": { + "text": "Stack on '{0}' is executable, which means that an attacker could use it as a place to store attack shellcode. Ensure you are compiling with '-z noexecstack' to mark the stack as non-executable." + }, + "Error_NoStackSeg": { + "text": "GNU_STACK segment on '{0}' is missing, which means the stack will likely be loaded as executable. Ensure you are using an up to date compiler and passing '-z noexecstack' to the compiler." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "DoNotMarkStackAsExecutable" + }, + { + "id": "BA3003", + "fullDescription": { + "text": "The stack protector ensures that all functions that use buffers over a certain size will use a stack cookie (and check it) to prevent stack based buffer overflows, exiting if stack smashing is detected. Use '--fstack-protector-strong' (all buffers of 4 bytes or more) or '--fstack-protector-all' (all functions) to enable this." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3003EnableStackProtector", + "help": { + "text": "The stack protector ensures that all functions that use buffers over a certain size will use a stack cookie (and check it) to prevent stack based buffer overflows, exiting if stack smashing is detected. Use '--fstack-protector-strong' (all buffers of 4 bytes or more) or '--fstack-protector-all' (all functions) to enable this." + }, + "messageStrings": { + "Pass": { + "text": "Stack protector was found on '{0}'. However, if you are not compiling with '--stack-protector-strong', it may provide additional protections." + }, + "Error": { + "text": "The stack protector was not found in '{0}'. This may be because the binary has no stack-based arrays, or because '--stack-protector-strong' was not used." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableStackProtector" + }, + { + "id": "BA3004", + "fullDescription": { + "text": "This check ensures that debugging dwarf version used is 5. The dwarf version 5 contains more information and should be used. Use the compiler flags '-gdwarf-5' to enable this." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3004GenerateRequiredSymbolFormat", + "help": { + "text": "This check ensures that debugging dwarf version used is 5. The dwarf version 5 contains more information and should be used. Use the compiler flags '-gdwarf-5' to enable this." + }, + "messageStrings": { + "Pass": { + "text": "The version of the debugging dwarf format is '{0}' for the file '{1}'" + }, + "Error": { + "text": "'{0}' is using debugging dwarf version '{1}'. The dwarf version 5 contains more information and should be used. To enable the debugging version 5 use '-gdwarf-5'." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "GenerateRequiredSymbolFormat" + }, + { + "id": "BA3005", + "fullDescription": { + "text": "This check ensures that stack clash protection is enabled. Each program running on a computer uses a special memory region called the stack. This memory region is special because it grows automatically when the program needs more stack memory. But if it grows too much and gets too close to another memory region, the program may confuse the stack with the other memory region. An attacker can exploit this confusion to overwrite the stack with the other memory region, or the other way around. Use the compiler flags '-fstack-clash-protection' to enable this." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3005EnableStackClashProtection", + "help": { + "text": "This check ensures that stack clash protection is enabled. Each program running on a computer uses a special memory region called the stack. This memory region is special because it grows automatically when the program needs more stack memory. But if it grows too much and gets too close to another memory region, the program may confuse the stack with the other memory region. An attacker can exploit this confusion to overwrite the stack with the other memory region, or the other way around. Use the compiler flags '-fstack-clash-protection' to enable this." + }, + "messageStrings": { + "Pass": { + "text": "The Stack Clash Protection was present, so '{0}' is protected." + }, + "Error": { + "text": "The Stack Clash Protection is missing from this binary, so the stack from '{0}' can clash/colide with another memory region. Ensure you are compiling with the compiler flags '-fstack-clash-protection' to address this." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableStackClashProtection" + }, + { + "id": "BA3010", + "fullDescription": { + "text": "This check ensures that some relocation data is marked as read only after the executable is loaded, and moved below the '.data' section in memory. This prevents them from being overwritten, which can redirect control flow. Use the compiler flags '-Wl,z,relro' to enable this." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3010EnableReadOnlyRelocations", + "help": { + "text": "This check ensures that some relocation data is marked as read only after the executable is loaded, and moved below the '.data' section in memory. This prevents them from being overwritten, which can redirect control flow. Use the compiler flags '-Wl,z,relro' to enable this." + }, + "messageStrings": { + "Pass": { + "text": "The GNU_RELRO segment was present, so '{0}' is protected." + }, + "Error": { + "text": "The GNU_RELRO segment is missing from this binary, so relocation sections in '{0}' will not be marked as read only after the binary is loaded. An attacker can overwrite these to redirect control flow. Ensure you are compiling with the compiler flags '-Wl,z,relro' to address this." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableReadOnlyRelocations" + }, + { + "id": "BA3011", + "fullDescription": { + "text": "This check ensures that some relocation data is marked as read only after the executable is loaded, and moved below the '.data' section in memory. This prevents them from being overwritten, which can redirect control flow. Use the compiler flags '-Wl,z,now' to enable this." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3011EnableBindNow", + "help": { + "text": "This check ensures that some relocation data is marked as read only after the executable is loaded, and moved below the '.data' section in memory. This prevents them from being overwritten, which can redirect control flow. Use the compiler flags '-Wl,z,now' to enable this." + }, + "messageStrings": { + "Pass": { + "text": "The BIND_NOW flag was present, so '{0}' is protected." + }, + "Error": { + "text": "The BIND_NOW flag is missing from this binary, so relocation sections in '{0}' will not be marked as read only after the binary is loaded. An attacker can overwrite these to redirect control flow. Ensure you are compiling with the compiler flags '-Wl,z,now' to address this." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableBindNow" + }, + { + "id": "BA3030", + "fullDescription": { + "text": "GCC can automatically replace unsafe functions with checked variants when it can statically determine the length of a buffer or string. In the case of an overflow, the checked version will safely exit the program (rather than potentially allowing an exploit). This feature can be enabled by passing '-DFortify_Source=2' when optimization level 2 is enabled ('-O2')." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3030UseCheckedFunctionsWithGcc", + "help": { + "text": "GCC can automatically replace unsafe functions with checked variants when it can statically determine the length of a buffer or string. In the case of an overflow, the checked version will safely exit the program (rather than potentially allowing an exploit). This feature can be enabled by passing '-DFortify_Source=2' when optimization level 2 is enabled ('-O2')." + }, + "messageStrings": { + "Pass_AllFunctionsChecked": { + "text": "All functions that can be checked in '{0}' are using the checked versions, so this binary is protected from overflows caused by those function's use." + }, + "Pass_SomeFunctionsChecked": { + "text": "Some checked functions were found in '{0}'; however, there were also some unchecked functions, which can occur when the compiler cannot statically determine the length of a buffer/string. We recommend reviewing your usage of functions like memcpy or strcpy." + }, + "Pass_NoCheckableFunctions": { + "text": "No unsafe functions which can be replaced with checked versions are used in '{0}'." + }, + "Error": { + "text": "No checked functions are present/used when compiling '{0}', and it was compiled with GCC--and it uses functions that can be checked. The Fortify Source flag replaces some unsafe functions with checked versions when a static length can be determined, and can be enabled by passing '-D_FORTIFY_SOURCE=2' when optimization level 2 ('-O2') is enabled. It is possible that the flag was passed, but that the compiler could not statically determine the length of any buffers/strings." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "UseCheckedFunctionsWithGcc" + }, + { + "id": "BA2001", + "fullDescription": { + "text": "64-bit images should have a preferred base address above the 4GB boundary to prevent triggering an Address Space Layout Randomization (ASLR) compatibility mode that decreases security. ASLR compatibility mode reduces the number of locations to which ASLR may relocate the binary, reducing its effectiveness at mitigating memory corruption vulnerabilities. To resolve this issue, either use the default preferred base address by removing any uses of /baseaddress from compiler command lines, or /BASE from linker command lines (recommended), or configure your program to start at a base address above 4GB when compiled for 64 bit platforms (by changing the constant passed to /baseaddress or /BASE). Note that if you choose to continue using a custom preferred base address, you will need to make this modification only for 64-bit builds, as base addresses above 4GB are not valid for 32-bit binaries." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2001LoadImageAboveFourGigabyteAddress", + "help": { + "text": "64-bit images should have a preferred base address above the 4GB boundary to prevent triggering an Address Space Layout Randomization (ASLR) compatibility mode that decreases security. ASLR compatibility mode reduces the number of locations to which ASLR may relocate the binary, reducing its effectiveness at mitigating memory corruption vulnerabilities. To resolve this issue, either use the default preferred base address by removing any uses of /baseaddress from compiler command lines, or /BASE from linker command lines (recommended), or configure your program to start at a base address above 4GB when compiled for 64 bit platforms (by changing the constant passed to /baseaddress or /BASE). Note that if you choose to continue using a custom preferred base address, you will need to make this modification only for 64-bit builds, as base addresses above 4GB are not valid for 32-bit binaries." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' is a 64-bit image with a base address that is >= 4 gigabytes, increasing the effectiveness of Address Space Layout Randomization (which helps prevent attackers from executing security-sensitive code in well-known locations)." + }, + "Error": { + "text": "'{0}' is a 64-bit image with a preferred base address below the 4GB boundary. Having a preferred base address below this boundary triggers a compatibility mode in Address Space Layout Randomization (ASLR) on recent versions of Windows that reduces the number of locations to which ASLR may relocate the binary. This reduces the effectiveness of ASLR at mitigating memory corruption vulnerabilities. To resolve this issue, either use the default preferred base address by removing any uses of /baseaddress from compiler command lines, or /BASE from linker command lines (recommended), or configure your program to start at a base address above 4GB when compiled for 64 bit platforms (by changing the constant passed to /baseaddress or /BASE). Note that if you choose to continue using a custom preferred base address, you will need to make this modification only for 64-bit builds, as base addresses above 4GB are not valid for 32-bit binaries." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "LoadImageAboveFourGigabyteAddress", + "properties": { + "equivalentBinScopeRuleReadableName": "FourGbCheck" + } + }, + { + "id": "BA2002", + "fullDescription": { + "text": "Binaries should not take dependencies on code with known security vulnerabilities." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2002DoNotIncorporateVulnerableDependencies", + "help": { + "text": "Binaries should not take dependencies on code with known security vulnerabilities." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' does not incorporate any known vulnerable dependencies, as configured by current policy." + }, + "Error": { + "text": "'{0}' was built with a version of {1} which is subject to the following issues: {2}. To resolve this, {3}. The source files that triggered this were: {4}" + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "DoNotIncorporateVulnerableDependencies", + "properties": { + "equivalentBinScopeRuleReadableName": "ATLVersionCheck" + } + }, + { + "id": "BA2004", + "fullDescription": { + "text": "Compilers can generate and store checksums of source files in order to provide linkage between binaries, their PDBs, and associated source code. This information is typically used to resolve source file when debugging but it can also be used to verify that a specific body of source code is, in fact, the code that was used to produce a specific set of binaries and PDBs. This validation is helpful in verifying supply chain integrity. Due to this security focus, it is important that the hashing algorithm used to produce checksums is secure. Legacy hashing algorithms, such as MD5 and SHA-1, have been demonstrated to be broken by modern hardware (that is, it is computationally feasible to force hash collisions, in which a common hash is generated from distinct files). Using a secure hashing algorithm, such as SHA-256, prevents the possibility of collision attacks, in which the checksum of a malicious file is used to produce a hash that satisfies the system that it is, in fact, the original file processed by the compiler. For managed binaries, pass '-checksumalgorithm:SHA256' on the csc.exe command-line or populate the '' project property with 'SHA256' to enable secure source code hashing. For native binaries, pass '/ZH:SHA_256' on the cl.exe command-line to enable secure source code hashing." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2004EnableSecureSourceCodeHashing", + "help": { + "text": "Compilers can generate and store checksums of source files in order to provide linkage between binaries, their PDBs, and associated source code. This information is typically used to resolve source file when debugging but it can also be used to verify that a specific body of source code is, in fact, the code that was used to produce a specific set of binaries and PDBs. This validation is helpful in verifying supply chain integrity. Due to this security focus, it is important that the hashing algorithm used to produce checksums is secure. Legacy hashing algorithms, such as MD5 and SHA-1, have been demonstrated to be broken by modern hardware (that is, it is computationally feasible to force hash collisions, in which a common hash is generated from distinct files). Using a secure hashing algorithm, such as SHA-256, prevents the possibility of collision attacks, in which the checksum of a malicious file is used to produce a hash that satisfies the system that it is, in fact, the original file processed by the compiler. For managed binaries, pass '-checksumalgorithm:SHA256' on the csc.exe command-line or populate the '' project property with 'SHA256' to enable secure source code hashing. For native binaries, pass '/ZH:SHA_256' on the cl.exe command-line to enable secure source code hashing." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' is a {1} binary which was compiled with a secure (SHA-256) source code hashing algorithm." + }, + "Warning_NativeWithInsecureStaticLibraryCompilands": { + "text": "'{0}' is a native binary that links one or more static libraries that include object files which were hashed using an insecure checksum algorithm (MD5). MD5 is subject to collision attacks and its use can compromise supply chain integrity. Pass '/ZH:SHA_256' on the cl.exe command-line to enable secure source code hashing. The following modules are out of policy:\r\n{1}" + }, + "Error_Managed": { + "text": "'{0}' is a managed binary compiled with an insecure (SHA-1) source code hashing algorithm. SHA-1 is subject to collision attacks and its use can compromise supply chain integrity. Pass '-checksumalgorithm:SHA256' on the csc.exe command-line or populate the project property with 'SHA256' to enable secure source code hashing." + }, + "Error_NativeWithInsecureDirectCompilands": { + "text": "'{0}' is a native binary that directly compiles and links one or more object files which were hashed using an insecure checksum algorithm (MD5). MD5 is subject to collision attacks and its use can compromise supply chain integrity. Pass '/ZH:SHA_256' on the cl.exe command-line to enable secure source code hashing. The following modules are out of policy:\r\n{1}" + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableSecureSourceCodeHashing" + }, + { + "id": "BA2005", + "fullDescription": { + "text": "Do not ship obsolete libraries for which there are known security vulnerabilities." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2005DoNotShipVulnerableBinaries", + "help": { + "text": "Do not ship obsolete libraries for which there are known security vulnerabilities." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' is not known to be an obsolete binary that is vulnerable to one or more security problems." + }, + "Error": { + "text": "'{0}' appears to be an obsolete library (version {1}) for which there are known security vulnerabilities. To resolve this issue, obtain a version of {0} that is newer than version {2}. If this binary is not in fact {0}, ignore this warning." + }, + "Error_CouldNotParseVersion": { + "text": "Version information for '{0}' could not be parsed. The binary therefore could not be verified not to be an obsolete binary that is known to be vulnerable to one or more security problems." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "DoNotShipVulnerableBinaries", + "properties": { + "equivalentBinScopeRuleReadableName": "BinaryVersionsCheck" + } + }, + { + "id": "BA2006", + "fullDescription": { + "text": "Application code should be compiled with the most up-to-date tool sets possible to take advantage of the most current compile-time security features. Among other things, these features provide address space layout randomization, help prevent arbitrary code execution, and enable code generation that can help prevent speculative execution side-channel attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2006BuildWithSecureTools", + "help": { + "text": "Application code should be compiled with the most up-to-date tool sets possible to take advantage of the most current compile-time security features. Among other things, these features provide address space layout randomization, help prevent arbitrary code execution, and enable code generation that can help prevent speculative execution side-channel attacks." + }, + "messageStrings": { + "Error": { + "text": "'{0}' was compiled with one or more modules which were not built using minimum required tool versions (compiler version {1}). More recent toolchains contain mitigations that make it more difficult for an attacker to exploit vulnerabilities in programs they produce. To resolve this issue, compile and/or link your binary with more recent tools. If you are servicing a product where the tool chain cannot be modified (e.g. producing a hotfix for an already shipped version) ignore this warning. Modules built outside of policy: \r\n{2}" + }, + "Error_BadModule": { + "text": "built with {0} compiler version {1} (Front end version {2})" + }, + "Pass": { + "text": "All linked modules of '{0}' satisfy configured policy (observed compilers: {1})." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "BuildWithSecureTools", + "properties": { + "equivalentBinScopeRuleReadableName": "CompilerVersionCheck" + } + }, + { + "id": "BA2007", + "fullDescription": { + "text": "Binaries should be compiled with a warning level that enables all critical security-relevant checks. Enabling at least warning level 3 enables important static analysis in the compiler that can identify bugs with a potential to provoke memory corruption, information disclosure, or double-free vulnerabilities. To resolve this issue, compile at warning level 3 or higher by supplying /W3, /W4, or /Wall to the compiler, and resolve the warnings emitted." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2007EnableCriticalCompilerWarnings", + "help": { + "text": "Binaries should be compiled with a warning level that enables all critical security-relevant checks. Enabling at least warning level 3 enables important static analysis in the compiler that can identify bugs with a potential to provoke memory corruption, information disclosure, or double-free vulnerabilities. To resolve this issue, compile at warning level 3 or higher by supplying /W3, /W4, or /Wall to the compiler, and resolve the warnings emitted." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' was compiled at a secure warning level ({1}) and does not include any modules that disable specific warnings that are required by policy. As a result, it is less likely that memory corruption, information disclosure, double-free and other security-related vulnerabilities exist in code." + }, + "Error_WarningsDisabled": { + "text": "'{0}' disables compiler warning(s) which are required by policy. A compiler warning is typically required if it has a high likelihood of flagging memory corruption, information disclosure, or double-free vulnerabilities. To resolve this issue, enable the indicated warning(s) by removing /Wxxxx switches (where xxxx is a warning id indicated here) from your command line, and resolve any warnings subsequently raised during compilation. An example compiler command line triggering this check was: {1}\r\nModules triggering this check were:\r\n{2}" + }, + "Error_InsufficientWarningLevel": { + "text": "'{0}' was compiled at too low a warning level (effective warning level {1} for one or more modules). Warning level 3 enables important static analysis in the compiler to flag bugs that can lead to memory corruption, information disclosure, or double-free vulnerabilities. To resolve this issue, compile at warning level 3 or higher by supplying /W3, /W4, or /Wall to the compiler, and resolve the warnings emitted. An example compiler command line triggering this check: {2}\r\nModules triggering this check: {3}" + }, + "Error_UnknownModuleLanguage": { + "text": "'{0}' contains code from an unknown language, preventing a comprehensive analysis of the compiler warning settings. The language could not be identified for the following modules: {1}" + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableCriticalCompilerWarnings", + "properties": { + "equivalentBinScopeRuleReadableName": "CompilerWarningsCheck" + } + }, + { + "id": "BA2008", + "fullDescription": { + "text": "Binaries should enable the compiler control guard feature (CFG) at build time to prevent attackers from redirecting execution to unexpected, unsafe locations. CFG analyzes and discovers all indirect-call instructions at compilation and link time. It also injects a check that precedes every indirect call in code that ensures the target is an expected, safe location. If that check fails at runtime, the operating system will close the program." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2008EnableControlFlowGuard", + "help": { + "text": "Binaries should enable the compiler control guard feature (CFG) at build time to prevent attackers from redirecting execution to unexpected, unsafe locations. CFG analyzes and discovers all indirect-call instructions at compilation and link time. It also injects a check that precedes every indirect call in code that ensures the target is an expected, safe location. If that check fails at runtime, the operating system will close the program." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the control flow guard mitigation. As a result, the operating system will force an application to close if an attacker is able to redirect execution in the component to an unexpected location." + }, + "Error": { + "text": "'{0}' does not enable the control flow guard (CFG) mitigation. To resolve this issue, pass /guard:cf on both the compiler and linker command lines. Binaries also require the /DYNAMICBASE linker option in order to enable CFG." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + }, + "NotApplicable_UnsupportedKernelModeVersion": { + "text": "'{0}' is a kernel mode portable executable compiled for a version of Windows that does not support the control flow guard feature for kernel mode binaries." + } + }, + "name": "EnableControlFlowGuard", + "properties": { + "equivalentBinScopeRuleReadableName": "ControlFlowGuardCheck" + } + }, + { + "id": "BA2009", + "fullDescription": { + "text": "Binaries should linked as DYNAMICBASE to be eligible for relocation by Address Space Layout Randomization (ASLR). ASLR is an important mitigation that makes it more difficult for an attacker to exploit memory corruption vulnerabilities. Configure your tools to build with this feature enabled. For C and C++ binaries, add /DYNAMICBASE to your linker command line. For .NET applications, use a compiler shipping with Visual Studio 2008 or later." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2009EnableAddressSpaceLayoutRandomization", + "help": { + "text": "Binaries should linked as DYNAMICBASE to be eligible for relocation by Address Space Layout Randomization (ASLR). ASLR is an important mitigation that makes it more difficult for an attacker to exploit memory corruption vulnerabilities. Configure your tools to build with this feature enabled. For C and C++ binaries, add /DYNAMICBASE to your linker command line. For .NET applications, use a compiler shipping with Visual Studio 2008 or later." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' is properly compiled to enable Address Space Layout Randomization, reducing an attacker's ability to exploit code in well-known locations." + }, + "Error_NotDynamicBase": { + "text": "'{0}' is not marked as DYNAMICBASE. This means that the binary is not eligible for relocation by Address Space Layout Randomization (ASLR). ASLR is an important mitigation that makes it more difficult for an attacker to exploit memory corruption vulnerabilities. To resolve this issue, configure your tools to build with this feature enabled. For C and C++ binaries, add /DYNAMICBASE to your linker command line. For .NET applications, use a compiler shipping with Visual Studio 2008 or later." + }, + "Error_RelocsStripped": { + "text": "'{0}' is marked as DYNAMICBASE but relocation data has been stripped from the image, preventing address space layout randomization. " + }, + "Error_WinCENoRelocationSection": { + "text": "'{0}' is a Windows CE image but does not contain any relocation data, preventing Address Space Layout Randomization." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableAddressSpaceLayoutRandomization", + "properties": { + "equivalentBinScopeRuleReadableName": "DBCheck" + } + }, + { + "id": "BA2010", + "fullDescription": { + "text": "PE sections should not be marked as both writable and executable. This condition makes it easier for an attacker to exploit memory corruption vulnerabilities, as it may provide an attacker executable location(s) to inject shellcode. Because the loader will always mark the imports section as writable, it is therefore important to mark this section as non-executable. To resolve this issue, ensure that your program does not mark the imports section executable. Look for uses of /SECTION or /MERGE on the linker command line, or #pragma segment in source code, which change the imports section to be executable, or which merge the \".rdata\" segment into an executable section." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2010DoNotMarkImportsSectionAsExecutable", + "help": { + "text": "PE sections should not be marked as both writable and executable. This condition makes it easier for an attacker to exploit memory corruption vulnerabilities, as it may provide an attacker executable location(s) to inject shellcode. Because the loader will always mark the imports section as writable, it is therefore important to mark this section as non-executable. To resolve this issue, ensure that your program does not mark the imports section executable. Look for uses of /SECTION or /MERGE on the linker command line, or #pragma segment in source code, which change the imports section to be executable, or which merge the \".rdata\" segment into an executable section." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' does not have an imports section that is marked as executable, helping to prevent the exploitation of code vulnerabilities." + }, + "Error": { + "text": "'{0}' has the imports section marked executable. Because the loader will always mark the imports section as writable, it is important to mark this section as non-executable, so that an attacker cannot place shellcode here. To resolve this issue, ensure that your program does not mark the imports section as executable. Look for uses of /SECTION or /MERGE on the linker command line, or #pragma segment in source code, which change the imports section to be executable, or which merge the \".rdata\" segment into an executable section." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "DoNotMarkImportsSectionAsExecutable", + "properties": { + "equivalentBinScopeRuleReadableName": "ExecutableImportsCheck" + } + }, + { + "id": "BA2011", + "fullDescription": { + "text": "Binaries should be built with the stack protector buffer security feature (/GS) enabled to increase the difficulty of exploiting stack buffer overflow memory corruption vulnerabilities. To resolve this issue, ensure that all modules compiled into the binary are compiled with the stack protector enabled by supplying /GS on the Visual C++ compiler command line." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2011EnableStackProtection", + "help": { + "text": "Binaries should be built with the stack protector buffer security feature (/GS) enabled to increase the difficulty of exploiting stack buffer overflow memory corruption vulnerabilities. To resolve this issue, ensure that all modules compiled into the binary are compiled with the stack protector enabled by supplying /GS on the Visual C++ compiler command line." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' is a C or C++ binary built with the stack protector buffer security feature enabled for all modules, making it more difficult for an attacker to exploit stack buffer overflow memory corruption vulnerabilities. " + }, + "Error": { + "text": "'{0}' is a C or C++ binary built with the stack protector buffer security feature disabled in one or more modules. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. To resolve this issue, ensure that your code is compiled with the stack protector enabled by supplying /GS on the Visual C++ compiler command line. The affected modules were: {1}" + }, + "Error_UnknownModuleLanguage": { + "text": "'{0}' contains code from an unknown language, preventing a comprehensive analysis of the stack protector buffer security features. The language could not be identified for the following modules: {1}." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableStackProtection", + "properties": { + "equivalentBinScopeRuleReadableName": "GSCheck" + } + }, + { + "id": "BA2012", + "fullDescription": { + "text": "Application code should not interfere with the stack protector. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. The stack protector relies on a random number, called the \"security cookie\", to detect these buffer overflows. This 'cookie' is statically linked with your binary from a Visual C++ library in the form of the symbol __security_cookie. On recent Windows versions, the loader looks for the statically linked value of this cookie, and initializes the cookie with a far better source of entropy -- the system's secure random number generator -- rather than the limited random number generator available early in the C runtime startup code. When this symbol is not the default value, the additional entropy is not injected by the operating system, reducing the effectiveness of the stack protector. To resolve this issue, ensure that your code does not reference or create a symbol named __security_cookie or __security_cookie_complement." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2012DoNotModifyStackProtectionCookie", + "help": { + "text": "Application code should not interfere with the stack protector. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. The stack protector relies on a random number, called the \"security cookie\", to detect these buffer overflows. This 'cookie' is statically linked with your binary from a Visual C++ library in the form of the symbol __security_cookie. On recent Windows versions, the loader looks for the statically linked value of this cookie, and initializes the cookie with a far better source of entropy -- the system's secure random number generator -- rather than the limited random number generator available early in the C runtime startup code. When this symbol is not the default value, the additional entropy is not injected by the operating system, reducing the effectiveness of the stack protector. To resolve this issue, ensure that your code does not reference or create a symbol named __security_cookie or __security_cookie_complement." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' is a C or C++ binary built with the buffer security feature that properly preserves the stack protecter cookie. This has the effect of enabling a significant increase in entropy provided by the operating system over that produced by the C runtime start-up code." + }, + "Pass_NoLoadConfig": { + "text": "'{0}' is C or C++binary that does not contain a load config table, which indicates either that it was compiled and linked with a version of the compiler that precedes stack protection features or is a binary (such as an ngen'ed assembly) that is not subject to relevant security issues." + }, + "Error": { + "text": "'{0}' is a C or C++ binary that interferes with the stack protector. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. The stack protector relies on a random number, called the \"security cookie\", to detect these buffer overflows. This 'cookie' is statically linked with your binary from a Visual C++ library in the form of the symbol __security_cookie. On recent Windows versions, the loader looks for the magic statically linked value of this cookie, and initializes the cookie with a far better source of entropy -- the system's secure random number generator -- rather than the limited random number generator available early in the C runtime startup code. When this symbol is not the default value, the additional entropy is not injected by the operating system, reducing the effectiveness of the stack protector. To resolve this issue, ensure that your code does not reference or create a symbol named __security_cookie or __security_cookie_complement. NOTE: the modified cookie value detected was: {1}" + }, + "Error_CouldNotLocateCookie": { + "text": "'{0}' is a C or C++binary that enables the stack protection feature but the security cookie could not be located. The binary may be corrupted." + }, + "Warning_InvalidSecurityCookieOffset": { + "text": "'{0}' appears to be a packed C or C++ binary that reports a security cookie offset that exceeds the size of the packed file. Use of the stack protector (/GS) feature therefore could not be verified. The file was possibly packed by: {1}." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "DoNotModifyStackProtectionCookie", + "properties": { + "equivalentBinScopeRuleReadableName": "DefaultGSCookieCheck" + } + }, + { + "id": "BA2013", + "fullDescription": { + "text": "Binaries should properly initialize the stack protector (/GS) in order to increase the difficulty of exploiting stack buffer overflow memory corruption vulnerabilities. The stack protector requires access to entropy in order to be effective, which means a binary must initialize a random number generator at startup, by calling __security_init_cookie() as close to the binary's entry point as possible. Failing to do so will result in spurious buffer overflow detections on the part of the stack protector. To resolve this issue, use the default entry point provided by the C runtime, which will make this call for you, or call __security_init_cookie() manually in your custom entry point." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2013InitializeStackProtection", + "help": { + "text": "Binaries should properly initialize the stack protector (/GS) in order to increase the difficulty of exploiting stack buffer overflow memory corruption vulnerabilities. The stack protector requires access to entropy in order to be effective, which means a binary must initialize a random number generator at startup, by calling __security_init_cookie() as close to the binary's entry point as possible. Failing to do so will result in spurious buffer overflow detections on the part of the stack protector. To resolve this issue, use the default entry point provided by the C runtime, which will make this call for you, or call __security_init_cookie() manually in your custom entry point." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' is a C or C++ binary built with the buffer security feature that properly initializes the stack protecter. This has the effect of increasing the effectiveness of the feature and reducing spurious detections." + }, + "Pass_NoCode": { + "text": "'{0}' is a C or C++ binary that is not required to initialize the stack protection, as it does not contain executable code." + }, + "NotApplicable_FeatureNotEnabled": { + "text": "'{0}' is a C or C++ binary that does not enable the stack protection buffer security feature. It is therefore not required to initialize the stack protector." + }, + "Error": { + "text": "'{0}' is a C or C++ binary that does not initialize the stack protector. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. The stack protector requires access to entropy in order to be effective, which means a binary must initialize a random number generator at startup, by calling __security_init_cookie() as close to the binary's entry point as possible. Failing to do so will result in spurious buffer overflow detections on the part of the stack protector. To resolve this issue, use the default entry point provided by the C runtime, which will make this call for you, or call __security_init_cookie() manually in your custom entry point." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "InitializeStackProtection", + "properties": { + "equivalentBinScopeRuleReadableName": "GSFriendlyInitCheck" + } + }, + { + "id": "BA2014", + "fullDescription": { + "text": "Application code should not disable stack protection for individual functions. The stack protector (/GS) is a security feature of the Windows native compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. Disabling the stack protector, even on a function-by-function basis, can compromise the security of code. To resolve this issue, remove occurrences of __declspec(safebuffers) from your code. If the additional code inserted by the stack protector has been shown in profiling to cause a significant performance problem for your application, attempt to move stack buffer modifications out of the hot path of execution to allow the compiler to avoid inserting stack protector checks in these locations rather than disabling the stack protector altogether." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2014DoNotDisableStackProtectionForFunctions", + "help": { + "text": "Application code should not disable stack protection for individual functions. The stack protector (/GS) is a security feature of the Windows native compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. Disabling the stack protector, even on a function-by-function basis, can compromise the security of code. To resolve this issue, remove occurrences of __declspec(safebuffers) from your code. If the additional code inserted by the stack protector has been shown in profiling to cause a significant performance problem for your application, attempt to move stack buffer modifications out of the hot path of execution to allow the compiler to avoid inserting stack protector checks in these locations rather than disabling the stack protector altogether." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' is a C or C++ binary built with the stack protector buffer security feature enabled which does not disable protection for any individual functions (via __declspec(safebuffers), making it more difficult for an attacker to exploit stack buffer overflow memory corruption vulnerabilities." + }, + "Error": { + "text": "'{0}' is a C or C++ binary built with function(s) ({1}) that disable the stack protector. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. Disabling the stack protector, even on a function-by-function basis, is disallowed by SDL policy. To resolve this issue, remove occurrences of __declspec(safebuffers) from your code. If the additional code inserted by the stack protector has been shown in profiling to cause a significant performance problem for your application, attempt to move stack buffer modifications out of the hot path of execution to allow the compiler to avoid inserting stack protector checks in these locations rather than disabling the stack protector altogether." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "DoNotDisableStackProtectionForFunctions", + "properties": { + "equivalentBinScopeRuleReadableName": "GSFunctionSafeBuffersCheck" + } + }, + { + "id": "BA2015", + "fullDescription": { + "text": "Binaries should be marked as high entropy Address Space Layout Randomization (ASLR) compatible. High entropy allows ASLR to be more effective in mitigating memory corruption vulnerabilities. To resolve this issue, configure your tool chain to mark the program high entropy compatible; e.g. by supplying /HIGHENTROPYVA to the C or C++ linker command line. Binaries must also be compiled as /LARGEADDRESSAWARE in order to enable high entropy ASLR." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2015EnableHighEntropyVirtualAddresses", + "help": { + "text": "Binaries should be marked as high entropy Address Space Layout Randomization (ASLR) compatible. High entropy allows ASLR to be more effective in mitigating memory corruption vulnerabilities. To resolve this issue, configure your tool chain to mark the program high entropy compatible; e.g. by supplying /HIGHENTROPYVA to the C or C++ linker command line. Binaries must also be compiled as /LARGEADDRESSAWARE in order to enable high entropy ASLR." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' is high entropy ASLR compatible, reducing an attacker's ability to exploit code in well-known locations." + }, + "Error_NoHighEntropyVA": { + "text": "'{0}' does not declare itself as high entropy ASLR compatible. High entropy makes Address Space Layout Randomization more effective in mitigating memory corruption vulnerabilities. To resolve this issue, configure your tools to mark the program high entropy compatible; e.g. by supplying /HIGHENTROPYVA to the C or C++ linker command line. (This image was determined to have been properly compiled as /LARGEADDRESSAWARE.)" + }, + "Error_NoLargeAddressAware": { + "text": "'{0}' does not declare itself as high entropy ASLR compatible. High entropy makes Address Space Layout Randomization more effective in mitigating memory corruption vulnerabilities. To resolve this issue, configure your tools to mark the program high entropy compatible by supplying /LARGEADDRESSAWARE to the C or C++ linker command line. (This image was determined to have been properly compiled as /HIGHENTROPYVA.)" + }, + "Error_NeitherHighEntropyVANorLargeAddressAware": { + "text": "'{0}' does not declare itself as high entropy ASLR compatible. High entropy makes Address Space Layout Randomization more effective in mitigating memory corruption vulnerabilities. To resolve this issue, configure your tools to mark the program high entropy compatible; e.g. by supplying /HIGHENTROPYVA as well as /LARGEADDRESSAWARE to the C or C++ linker command line." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableHighEntropyVirtualAddresses", + "properties": { + "equivalentBinScopeRuleReadableName": "HighEntropyVACheck" + } + }, + { + "id": "BA2019", + "fullDescription": { + "text": "Code or data sections should not be marked as both shared and writable. Because these sections are shared across processes, this condition might permit a process with low privilege to alter memory in a higher privilege process. If you do not actually require that a section be both writable and shared, remove one or both of these attributes (by modifying your .DEF file, the appropriate linker /section switch arguments, etc.). If you must share common data across processes (for inter-process communication (IPC) or other purposes) use CreateFileMapping with proper security attributes or an actual IPC mechanism instead (COM, named pipes, LPC, etc.)." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2019DoNotMarkWritableSectionsAsShared", + "help": { + "text": "Code or data sections should not be marked as both shared and writable. Because these sections are shared across processes, this condition might permit a process with low privilege to alter memory in a higher privilege process. If you do not actually require that a section be both writable and shared, remove one or both of these attributes (by modifying your .DEF file, the appropriate linker /section switch arguments, etc.). If you must share common data across processes (for inter-process communication (IPC) or other purposes) use CreateFileMapping with proper security attributes or an actual IPC mechanism instead (COM, named pipes, LPC, etc.)." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' contains no data or code sections marked as both shared and writable, helping to prevent the exploitation of code vulnerabilities." + }, + "Error": { + "text": "'{0}' contains one or more code or data sections ({1}) which are marked as both shared and writable. Because these sections are shared across processes, this condition might permit a process with low privilege to alter memory in a higher privilege process. If you do not actually require that a section be both writable and shared, remove one or both of these attributes (by modifying your .DEF file, the appropriate linker /section switch arguments, etc.). If you must share common data across processes (for inter-process communication (IPC) or other purposes) use CreateFileMapping with proper security attributes or an actual IPC mechanism instead (COM, named pipes, LPC, etc.)." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "DoNotMarkWritableSectionsAsShared", + "properties": { + "equivalentBinScopeRuleReadableName": "SharedSectionCheck" + } + }, + { + "id": "BA2021", + "fullDescription": { + "text": "PE sections should not be marked as both writable and executable. This condition makes it easier for an attacker to exploit memory corruption vulnerabilities, as it may provide an attacker executable location(s) to inject shellcode. To resolve this issue, configure your tools to not emit memory sections that are writable and executable. For example, look for uses of /SECTION on the linker command line for C and C++ programs, or #pragma section in C and C++ source code, which mark a section with both attributes. Be sure to disable incremental linking in release builds, as this feature creates a writable and executable section named '.textbss' in order to function." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2021DoNotMarkWritableSectionsAsExecutable", + "help": { + "text": "PE sections should not be marked as both writable and executable. This condition makes it easier for an attacker to exploit memory corruption vulnerabilities, as it may provide an attacker executable location(s) to inject shellcode. To resolve this issue, configure your tools to not emit memory sections that are writable and executable. For example, look for uses of /SECTION on the linker command line for C and C++ programs, or #pragma section in C and C++ source code, which mark a section with both attributes. Be sure to disable incremental linking in release builds, as this feature creates a writable and executable section named '.textbss' in order to function." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' contains no data or code sections marked as both shared and executable, helping to prevent the exploitation of code vulnerabilities." + }, + "Error": { + "text": "'{0}' contains PE section(s) ({1}) that are both writable and executable. Writable and executable memory segments make it easier for an attacker to exploit memory corruption vulnerabilities, because it may provide an attacker executable location(s) to inject shellcode. To resolve this issue, configure your tools to not emit memory sections that are writable and executable. For example, look for uses of /SECTION on the linker command line for C and C++ programs, or #pragma section in C and C++ source code, which mark a section with both attributes. Enabling incremental linking via the /INCREMENTAL argument (the default for Microsoft Visual Studio debug build) can also result in a writable and executable section named 'textbss'. For this case, disable incremental linking (or analyze an alternate build configuration that disables this feature) to resolve the problem." + }, + "Error_UnexpectedSectionAligment": { + "text": "'{0}' has a section alignment ({1}) that is smaller than its page size ({2})." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "DoNotMarkWritableSectionsAsExecutable", + "properties": { + "equivalentBinScopeRuleReadableName": "WXCheck" + } + }, + { + "id": "BA2022", + "fullDescription": { + "text": "Images should be correctly signed by trusted publishers using cryptographically secure signature algorithms. This rule invokes WinTrustVerify to validate that binary hash, signing and public key algorithms are secure and, where configurable, that key sizes meet acceptable size thresholds." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2022SignSecurely", + "help": { + "text": "Images should be correctly signed by trusted publishers using cryptographically secure signature algorithms. This rule invokes WinTrustVerify to validate that binary hash, signing and public key algorithms are secure and, where configurable, that key sizes meet acceptable size thresholds." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' appears to be signed with secure cryptographic algorithms. WinTrustVerify successfully validated the binary but did not attempt to validate certificate chaining or that the root certificate is trusted. The following digitial signature algorithms were detected: {1}" + }, + "Error_BadSigningAlgorithm": { + "text": "'{0}' was signed exclusively with algorithms that WinTrustVerify has flagged as insecure. {1}" + }, + "Error_DidNotVerify": { + "text": "'{0}' signing was flagged as insecure by WinTrustVerify with error code '{1}' ({2})" + }, + "Error_WinTrustVerifyApiError": { + "text": "'{0}' signing could not be completely verified because '{1}' failed with error code: '{2}'." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "SignSecurely" + }, + { + "id": "BA2024", + "fullDescription": { + "text": "Application code should be compiled with the Spectre mitigations switch (/Qspectre) and toolsets that support it." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2024EnableSpectreMitigations", + "help": { + "text": "Application code should be compiled with the Spectre mitigations switch (/Qspectre) and toolsets that support it." + }, + "messageStrings": { + "Warning": { + "text": "'{0}' was compiled with one or more modules that do not enable code generation mitigations for speculative execution side-channel attack (Spectre) vulnerabilities. Spectre attacks can compromise hardware-based isolation, allowing non-privileged users to retrieve potentially sensitive data from the CPU cache. To resolve the issue, provide the /Qspectre switch on the compiler command-line (or /d2guardspecload in cases where your compiler supports this switch and it is not possible to update to a toolset that supports /Qspectre). This warning should be addressed for code that operates on data that crosses a trust boundary and that can affect execution, such as parsing untrusted file inputs or processing query strings of a web request.\r\n{1}" + }, + "Warning_OptimizationsDisabled": { + "text": "The following modules were compiled with optimizations disabled (/Od), a condition that disables Spectre mitigations:\r\n{0}" + }, + "Warning_SpectreMitigationNotEnabled": { + "text": "The following modules were compiled with a toolset that supports /Qspectre but the switch was not enabled on the command-line:\r\n{0}" + }, + "Warning_SpectreMitigationExplicitlyDisabled": { + "text": "The following modules were compiled with Spectre mitigations explicitly disabled:\r\n{0}" + }, + "Pass": { + "text": "All linked modules '{0}' were compiled with mitigations enabled that help prevent Spectre (speculative execution side-channel attack) vulnerabilities." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableSpectreMitigations" + }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + } + ], + "properties": { + "Comments": "A security and correctness analyzer for portable executable and MSIL formats." + } + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe" + }, + "hashes": { + "md5": "A4E5C4E878954CFF01D1AFDC13CAA81D", + "sha-1": "6EDA0F9CB1317544358DA361A06B89E2340CB85B", + "sha-256": "5EA0EC5C73C0313BB7AC0B830F88F2D1E04936A0E45F1B7BCA9817503CFD9610" + } + } + ], + "columnKind": "utf16CodeUnits" + } + ] +} \ No newline at end of file diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2013_Default.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2013_Default.dll.sarif index f82c471f7..3cbb2b8e0 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2013_Default.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2013_Default.dll.sarif @@ -668,6 +668,26 @@ } } ] + }, + { + "ruleId": "BA2025", + "ruleIndex": 28, + "message": { + "id": "Warning", + "arguments": [ + "Native_x64_VS2013_Default.dll" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_VS2013_Default.dll", + "index": 0 + } + } + } + ] } ], "tool": { @@ -790,11 +810,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1425,6 +1445,28 @@ } }, "name": "EnableSpectreMitigations" + }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" } ], "properties": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2015_CvtresResourceOnly.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2015_CvtresResourceOnly.dll.sarif index f0d1dc321..c1693efef 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2015_CvtresResourceOnly.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2015_CvtresResourceOnly.dll.sarif @@ -317,10 +317,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 13, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_x64_VS2015_CvtresResourceOnly.dll", + "EnableShadowStack", + "image is a resource-only binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_VS2015_CvtresResourceOnly.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 14, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -342,7 +366,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "notApplicable", "level": "none", "message": { @@ -510,7 +534,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -532,7 +556,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -554,7 +578,7 @@ }, { "ruleId": "BA2010", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -576,7 +600,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -598,7 +622,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -620,7 +644,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "notApplicable", "level": "none", "message": { @@ -1018,14 +1042,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2015_Default.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2015_Default.dll.sarif index e585ae523..199b0db52 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2015_Default.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2015_Default.dll.sarif @@ -665,6 +665,26 @@ } } ] + }, + { + "ruleId": "BA2025", + "ruleIndex": 28, + "message": { + "id": "Warning", + "arguments": [ + "Native_x64_VS2015_Default.dll" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_VS2015_Default.dll", + "index": 0 + } + } + } + ] } ], "tool": { @@ -759,11 +779,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1422,6 +1442,28 @@ } }, "name": "EnableSpectreMitigations" + }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" } ], "properties": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2019_Atl_NoPdbGenerated.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2019_Atl_NoPdbGenerated.dll.sarif index 8e7a0a51a..dcc67a7fe 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2019_Atl_NoPdbGenerated.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x64_VS2019_Atl_NoPdbGenerated.dll.sarif @@ -560,11 +560,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1173,6 +1173,27 @@ "associatedRule": { "id": "BA2024" } + }, + { + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_VS2019_Atl_NoPdbGenerated.dll" + } + } + } + ], + "message": { + "text": "'Native_x64_VS2019_Atl_NoPdbGenerated.dll' was not evaluated for check 'EnableShadowStack' because its PDB could not be loaded (E_PDB_NO_DEBUG_INFO)." + }, + "level": "error", + "descriptor": { + "id": "ERR997.ExceptionLoadingPdb" + }, + "associatedRule": { + "id": "BA2025" + } } ], "executionSuccessful": false diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2013_Default.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2013_Default.exe.sarif index 1f74a117f..f8a78b6cb 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2013_Default.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2013_Default.exe.sarif @@ -666,6 +666,26 @@ } } ] + }, + { + "ruleId": "BA2025", + "ruleIndex": 28, + "message": { + "id": "Warning", + "arguments": [ + "Native_x86_VS2013_Default.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x86_VS2013_Default.exe", + "index": 0 + } + } + } + ] } ], "tool": { @@ -760,11 +780,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1423,6 +1443,28 @@ } }, "name": "EnableSpectreMitigations" + }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" } ], "properties": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2013_PdbMissing.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2013_PdbMissing.exe.sarif index b2fa24fd3..c84962595 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2013_PdbMissing.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2013_PdbMissing.exe.sarif @@ -561,11 +561,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1174,6 +1174,27 @@ "associatedRule": { "id": "BA2024" } + }, + { + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x86_VS2013_PdbMissing.exe" + } + } + } + ], + "message": { + "text": "'Native_x86_VS2013_PdbMissing.exe' was not evaluated for check 'EnableShadowStack' because its PDB could not be loaded (E_PDB_NOT_FOUND)." + }, + "level": "error", + "descriptor": { + "id": "ERR997.ExceptionLoadingPdb" + }, + "associatedRule": { + "id": "BA2025" + } } ], "executionSuccessful": false diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2013_ResourceOnly.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2013_ResourceOnly.dll.sarif index 0447bee83..b9efe4fe5 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2013_ResourceOnly.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2013_ResourceOnly.dll.sarif @@ -317,10 +317,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 13, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_x86_VS2013_ResourceOnly.dll", + "EnableShadowStack", + "image is a resource-only binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x86_VS2013_ResourceOnly.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 14, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -342,7 +366,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "notApplicable", "level": "none", "message": { @@ -510,7 +534,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -533,7 +557,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -555,7 +579,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -577,7 +601,7 @@ }, { "ruleId": "BA2010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -599,7 +623,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -621,7 +645,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -643,7 +667,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1041,14 +1065,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_AtlProxyStubPS.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_AtlProxyStubPS.dll.sarif index 2567de1de..e941b91c6 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_AtlProxyStubPS.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_AtlProxyStubPS.dll.sarif @@ -664,6 +664,26 @@ } } ] + }, + { + "ruleId": "BA2025", + "ruleIndex": 28, + "message": { + "id": "Warning", + "arguments": [ + "Native_x86_VS2015_AtlProxyStubPS.dll" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x86_VS2015_AtlProxyStubPS.dll", + "index": 0 + } + } + } + ] } ], "tool": { @@ -730,11 +750,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1421,6 +1441,28 @@ } }, "name": "EnableSpectreMitigations" + }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" } ], "properties": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_CvtresResourceOnly.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_CvtresResourceOnly.dll.sarif index c17e1b0a6..cbf7b5048 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_CvtresResourceOnly.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_CvtresResourceOnly.dll.sarif @@ -317,10 +317,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 13, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Native_x86_VS2015_CvtresResourceOnly.dll", + "EnableShadowStack", + "image is a resource-only binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x86_VS2015_CvtresResourceOnly.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 14, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -342,7 +366,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "notApplicable", "level": "none", "message": { @@ -510,7 +534,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -532,7 +556,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -554,7 +578,7 @@ }, { "ruleId": "BA2010", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -576,7 +600,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -598,7 +622,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -620,7 +644,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "notApplicable", "level": "none", "message": { @@ -1018,14 +1042,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_Default.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_Default.exe.sarif index a019c800e..17a9152e3 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_Default.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_Default.exe.sarif @@ -663,6 +663,26 @@ } } ] + }, + { + "ruleId": "BA2025", + "ruleIndex": 28, + "message": { + "id": "Warning", + "arguments": [ + "Native_x86_VS2015_Default.exe" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x86_VS2015_Default.exe", + "index": 0 + } + } + } + ] } ], "tool": { @@ -729,11 +749,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1420,6 +1440,28 @@ } }, "name": "EnableSpectreMitigations" + }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" } ], "properties": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_Default_Debug.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_Default_Debug.dll.sarif index 27d202225..55360e324 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_Default_Debug.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2015_Default_Debug.dll.sarif @@ -663,6 +663,26 @@ } } ] + }, + { + "ruleId": "BA2025", + "ruleIndex": 28, + "message": { + "id": "Warning", + "arguments": [ + "Native_x86_VS2015_Default_Debug.dll" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x86_VS2015_Default_Debug.dll", + "index": 0 + } + } + } + ] } ], "tool": { @@ -729,11 +749,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1420,6 +1440,28 @@ } }, "name": "EnableSpectreMitigations" + }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" } ], "properties": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2017_15.5.4_PdbStripped.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2017_15.5.4_PdbStripped.dll.sarif index 65ace0524..38a618900 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2017_15.5.4_PdbStripped.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Native_x86_VS2017_15.5.4_PdbStripped.dll.sarif @@ -531,11 +531,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1172,6 +1172,27 @@ "associatedRule": { "id": "BA2024" } + }, + { + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x86_VS2017_15.5.4_PdbStripped.dll" + } + } + } + ], + "message": { + "text": "'Native_x86_VS2017_15.5.4_PdbStripped.dll' was not evaluated for check 'EnableShadowStack' because its PDB could not be loaded (E_PDB_MAX)." + }, + "level": "error", + "descriptor": { + "id": "ERR997.ExceptionLoadingPdb" + }, + "associatedRule": { + "id": "BA2025" + } } ], "executionSuccessful": false diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM64_VS2019_Cpp.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM64_VS2019_Cpp.dll.sarif index 4cb2fd44f..0054a098a 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM64_VS2019_Cpp.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM64_VS2019_Cpp.dll.sarif @@ -101,10 +101,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 4, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Uwp_ARM64_VS2019_Cpp.dll", + "EnableShadowStack", + "image is a native UWP (Universal Windows Platform) binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Uwp_ARM64_VS2019_Cpp.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 5, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -126,7 +150,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 5, + "ruleIndex": 6, "kind": "notApplicable", "level": "none", "message": { @@ -150,7 +174,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 6, + "ruleIndex": 7, "kind": "notApplicable", "level": "none", "message": { @@ -174,7 +198,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 7, + "ruleIndex": 8, "kind": "notApplicable", "level": "none", "message": { @@ -198,7 +222,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 8, + "ruleIndex": 9, "kind": "notApplicable", "level": "none", "message": { @@ -222,7 +246,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 9, + "ruleIndex": 10, "kind": "notApplicable", "level": "none", "message": { @@ -246,7 +270,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 10, + "ruleIndex": 11, "kind": "notApplicable", "level": "none", "message": { @@ -270,7 +294,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 11, + "ruleIndex": 12, "kind": "notApplicable", "level": "none", "message": { @@ -294,7 +318,7 @@ }, { "ruleId": "BA2001", - "ruleIndex": 12, + "ruleIndex": 13, "kind": "pass", "level": "none", "message": { @@ -316,7 +340,7 @@ }, { "ruleId": "BA2002", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "pass", "level": "none", "message": { @@ -338,7 +362,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 14, + "ruleIndex": 15, "message": { "id": "Warning_NativeWithInsecureStaticLibraryCompilands", "arguments": [ @@ -359,7 +383,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 14, + "ruleIndex": 15, "level": "error", "message": { "id": "Error_NativeWithInsecureDirectCompilands", @@ -381,7 +405,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "pass", "level": "none", "message": { @@ -403,7 +427,7 @@ }, { "ruleId": "BA2006", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "pass", "level": "none", "message": { @@ -426,7 +450,7 @@ }, { "ruleId": "BA2007", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "pass", "level": "none", "message": { @@ -449,7 +473,7 @@ }, { "ruleId": "BA2008", - "ruleIndex": 18, + "ruleIndex": 19, "level": "error", "message": { "id": "Error", @@ -470,7 +494,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "pass", "level": "none", "message": { @@ -492,7 +516,7 @@ }, { "ruleId": "BA2010", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -514,7 +538,7 @@ }, { "ruleId": "BA2011", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -536,7 +560,7 @@ }, { "ruleId": "BA2012", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -558,7 +582,7 @@ }, { "ruleId": "BA2013", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -580,7 +604,7 @@ }, { "ruleId": "BA2014", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -602,7 +626,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -624,7 +648,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -646,7 +670,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -789,14 +813,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM_VS2015_DefaultBlankApp.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM_VS2015_DefaultBlankApp.dll.sarif index 8c21bee7c..b1ee8447d 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM_VS2015_DefaultBlankApp.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM_VS2015_DefaultBlankApp.dll.sarif @@ -783,11 +783,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1271,6 +1271,27 @@ "associatedRule": { "id": "BA2024" } + }, + { + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Uwp_ARM_VS2015_DefaultBlankApp.dll" + } + } + } + ], + "message": { + "text": "'Uwp_ARM_VS2015_DefaultBlankApp.dll' was not evaluated for check 'EnableShadowStack' because its PDB could not be loaded (E_PDB_NOT_FOUND)." + }, + "level": "error", + "descriptor": { + "id": "ERR997.ExceptionLoadingPdb" + }, + "associatedRule": { + "id": "BA2025" + } } ], "executionSuccessful": false diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM_VS2015_DefaultBlankApp.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM_VS2015_DefaultBlankApp.exe.sarif index 1cb858418..45df2daad 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM_VS2015_DefaultBlankApp.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM_VS2015_DefaultBlankApp.exe.sarif @@ -591,11 +591,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1176,6 +1176,27 @@ "associatedRule": { "id": "BA2024" } + }, + { + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Uwp_ARM_VS2015_DefaultBlankApp.exe" + } + } + } + ], + "message": { + "text": "'Uwp_ARM_VS2015_DefaultBlankApp.exe' was not evaluated for check 'EnableShadowStack' because its PDB could not be loaded (E_PDB_NO_DEBUG_INFO)." + }, + "level": "error", + "descriptor": { + "id": "ERR997.ExceptionLoadingPdb" + }, + "associatedRule": { + "id": "BA2025" + } } ], "executionSuccessful": false diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM_VS2017_VB.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM_VS2017_VB.dll.sarif index e65eb6381..0cde2d5c9 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM_VS2017_VB.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_ARM_VS2017_VB.dll.sarif @@ -317,10 +317,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 13, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Uwp_ARM_VS2017_VB.dll", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Uwp_ARM_VS2017_VB.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 14, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -342,7 +366,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "notApplicable", "level": "none", "message": { @@ -510,7 +534,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 21, + "ruleIndex": 22, "message": { "id": "Error_Managed", "arguments": [ @@ -530,7 +554,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -552,7 +576,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -574,7 +598,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -596,7 +620,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -618,7 +642,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -640,7 +664,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1038,14 +1062,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_AnyCpu_VS2019_Vb_ClassLibrary.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_AnyCpu_VS2019_Vb_ClassLibrary.dll.sarif index e25d5f223..d3cd629e4 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_AnyCpu_VS2019_Vb_ClassLibrary.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_AnyCpu_VS2019_Vb_ClassLibrary.dll.sarif @@ -293,10 +293,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 12, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Uwp_AnyCpu_VS2019_Vb_ClassLibrary.dll", + "EnableShadowStack", + "image is a managed IL-only assembly" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Uwp_AnyCpu_VS2019_Vb_ClassLibrary.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 13, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -318,7 +342,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "notApplicable", "level": "none", "message": { @@ -486,7 +510,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 20, + "ruleIndex": 21, "message": { "id": "Error_Managed", "arguments": [ @@ -506,7 +530,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -528,7 +552,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -550,7 +574,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -572,7 +596,7 @@ }, { "ruleId": "BA2018", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -594,7 +618,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -616,7 +640,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -638,7 +662,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -1008,14 +1032,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2015_DefaultBlankApp.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2015_DefaultBlankApp.dll.sarif index 5653f3301..32902ea3a 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2015_DefaultBlankApp.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2015_DefaultBlankApp.dll.sarif @@ -783,11 +783,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1271,6 +1271,27 @@ "associatedRule": { "id": "BA2024" } + }, + { + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Uwp_x64_VS2015_DefaultBlankApp.dll" + } + } + } + ], + "message": { + "text": "'Uwp_x64_VS2015_DefaultBlankApp.dll' was not evaluated for check 'EnableShadowStack' because its PDB could not be loaded (E_PDB_NOT_FOUND)." + }, + "level": "error", + "descriptor": { + "id": "ERR997.ExceptionLoadingPdb" + }, + "associatedRule": { + "id": "BA2025" + } } ], "executionSuccessful": false diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2015_DefaultBlankApp.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2015_DefaultBlankApp.exe.sarif index bd7af81f8..d172d910c 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2015_DefaultBlankApp.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2015_DefaultBlankApp.exe.sarif @@ -558,11 +558,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1174,6 +1174,27 @@ "associatedRule": { "id": "BA2024" } + }, + { + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Uwp_x64_VS2015_DefaultBlankApp.exe" + } + } + } + ], + "message": { + "text": "'Uwp_x64_VS2015_DefaultBlankApp.exe' was not evaluated for check 'EnableShadowStack' because its PDB could not be loaded (E_PDB_NO_DEBUG_INFO)." + }, + "level": "error", + "descriptor": { + "id": "ERR997.ExceptionLoadingPdb" + }, + "associatedRule": { + "id": "BA2025" + } } ], "executionSuccessful": false diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2017_Cpp.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2017_Cpp.dll.sarif index 6af8fbafd..384493cef 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2017_Cpp.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2017_Cpp.dll.sarif @@ -77,10 +77,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 3, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Uwp_x64_VS2017_Cpp.dll", + "EnableShadowStack", + "image is a native UWP (Universal Windows Platform) binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Uwp_x64_VS2017_Cpp.dll", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 4, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -102,7 +126,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 4, + "ruleIndex": 5, "kind": "notApplicable", "level": "none", "message": { @@ -126,7 +150,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 5, + "ruleIndex": 6, "kind": "notApplicable", "level": "none", "message": { @@ -150,7 +174,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 6, + "ruleIndex": 7, "kind": "notApplicable", "level": "none", "message": { @@ -174,7 +198,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 7, + "ruleIndex": 8, "kind": "notApplicable", "level": "none", "message": { @@ -198,7 +222,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 8, + "ruleIndex": 9, "kind": "notApplicable", "level": "none", "message": { @@ -222,7 +246,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 9, + "ruleIndex": 10, "kind": "notApplicable", "level": "none", "message": { @@ -246,7 +270,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 10, + "ruleIndex": 11, "kind": "notApplicable", "level": "none", "message": { @@ -270,7 +294,7 @@ }, { "ruleId": "BA2002", - "ruleIndex": 11, + "ruleIndex": 12, "kind": "pass", "level": "none", "message": { @@ -292,7 +316,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 12, + "ruleIndex": 13, "message": { "id": "Warning_NativeWithInsecureStaticLibraryCompilands", "arguments": [ @@ -313,7 +337,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 12, + "ruleIndex": 13, "level": "error", "message": { "id": "Error_NativeWithInsecureDirectCompilands", @@ -335,7 +359,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "pass", "level": "none", "message": { @@ -357,7 +381,7 @@ }, { "ruleId": "BA2006", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "pass", "level": "none", "message": { @@ -380,7 +404,7 @@ }, { "ruleId": "BA2007", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "pass", "level": "none", "message": { @@ -403,7 +427,7 @@ }, { "ruleId": "BA2008", - "ruleIndex": 16, + "ruleIndex": 17, "level": "error", "message": { "id": "Error", @@ -424,7 +448,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "pass", "level": "none", "message": { @@ -446,7 +470,7 @@ }, { "ruleId": "BA2010", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "pass", "level": "none", "message": { @@ -468,7 +492,7 @@ }, { "ruleId": "BA2011", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "pass", "level": "none", "message": { @@ -490,7 +514,7 @@ }, { "ruleId": "BA2012", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -512,7 +536,7 @@ }, { "ruleId": "BA2013", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA2014", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -556,7 +580,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -578,7 +602,7 @@ }, { "ruleId": "BA2018", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -600,7 +624,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -622,7 +646,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -644,7 +668,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -759,14 +783,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2019_Cpp_DirectX12.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2019_Cpp_DirectX12.exe.sarif index de2c5f5ba..5bbed8a85 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2019_Cpp_DirectX12.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x64_VS2019_Cpp_DirectX12.exe.sarif @@ -77,10 +77,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 3, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Uwp_x64_VS2019_Cpp_DirectX12.exe", + "EnableShadowStack", + "image is a native UWP (Universal Windows Platform) binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Uwp_x64_VS2019_Cpp_DirectX12.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 4, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -102,7 +126,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 4, + "ruleIndex": 5, "kind": "notApplicable", "level": "none", "message": { @@ -126,7 +150,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 5, + "ruleIndex": 6, "kind": "notApplicable", "level": "none", "message": { @@ -150,7 +174,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 6, + "ruleIndex": 7, "kind": "notApplicable", "level": "none", "message": { @@ -174,7 +198,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 7, + "ruleIndex": 8, "kind": "notApplicable", "level": "none", "message": { @@ -198,7 +222,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 8, + "ruleIndex": 9, "kind": "notApplicable", "level": "none", "message": { @@ -222,7 +246,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 9, + "ruleIndex": 10, "kind": "notApplicable", "level": "none", "message": { @@ -246,7 +270,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 10, + "ruleIndex": 11, "kind": "notApplicable", "level": "none", "message": { @@ -270,7 +294,7 @@ }, { "ruleId": "BA2001", - "ruleIndex": 11, + "ruleIndex": 12, "kind": "pass", "level": "none", "message": { @@ -292,7 +316,7 @@ }, { "ruleId": "BA2002", - "ruleIndex": 12, + "ruleIndex": 13, "kind": "pass", "level": "none", "message": { @@ -314,7 +338,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 13, + "ruleIndex": 14, "message": { "id": "Warning_NativeWithInsecureStaticLibraryCompilands", "arguments": [ @@ -335,7 +359,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 13, + "ruleIndex": 14, "level": "error", "message": { "id": "Error_NativeWithInsecureDirectCompilands", @@ -357,7 +381,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "pass", "level": "none", "message": { @@ -379,7 +403,7 @@ }, { "ruleId": "BA2006", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "pass", "level": "none", "message": { @@ -402,7 +426,7 @@ }, { "ruleId": "BA2007", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "pass", "level": "none", "message": { @@ -425,7 +449,7 @@ }, { "ruleId": "BA2008", - "ruleIndex": 17, + "ruleIndex": 18, "level": "error", "message": { "id": "Error", @@ -446,7 +470,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "pass", "level": "none", "message": { @@ -468,7 +492,7 @@ }, { "ruleId": "BA2010", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "pass", "level": "none", "message": { @@ -490,7 +514,7 @@ }, { "ruleId": "BA2011", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -512,7 +536,7 @@ }, { "ruleId": "BA2012", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA2013", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -556,7 +580,7 @@ }, { "ruleId": "BA2014", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -578,7 +602,7 @@ }, { "ruleId": "BA2015", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -600,7 +624,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -622,7 +646,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -644,7 +668,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -756,14 +780,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x86_VS2015_DefaultBlankApp.dll.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x86_VS2015_DefaultBlankApp.dll.sarif index 9f7e2235b..fb0aa365d 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x86_VS2015_DefaultBlankApp.dll.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x86_VS2015_DefaultBlankApp.dll.sarif @@ -753,11 +753,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1269,6 +1269,27 @@ "associatedRule": { "id": "BA2024" } + }, + { + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Uwp_x86_VS2015_DefaultBlankApp.dll" + } + } + } + ], + "message": { + "text": "'Uwp_x86_VS2015_DefaultBlankApp.dll' was not evaluated for check 'EnableShadowStack' because its PDB could not be loaded (E_PDB_NOT_FOUND)." + }, + "level": "error", + "descriptor": { + "id": "ERR997.ExceptionLoadingPdb" + }, + "associatedRule": { + "id": "BA2025" + } } ], "executionSuccessful": false diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x86_VS2015_DefaultBlankApp.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x86_VS2015_DefaultBlankApp.exe.sarif index e28424b72..d8b6da3ef 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x86_VS2015_DefaultBlankApp.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x86_VS2015_DefaultBlankApp.exe.sarif @@ -561,11 +561,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { @@ -1174,6 +1174,27 @@ "associatedRule": { "id": "BA2024" } + }, + { + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Uwp_x86_VS2015_DefaultBlankApp.exe" + } + } + } + ], + "message": { + "text": "'Uwp_x86_VS2015_DefaultBlankApp.exe' was not evaluated for check 'EnableShadowStack' because its PDB could not be loaded (E_PDB_NO_DEBUG_INFO)." + }, + "level": "error", + "descriptor": { + "id": "ERR997.ExceptionLoadingPdb" + }, + "associatedRule": { + "id": "BA2025" + } } ], "executionSuccessful": false diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x86_VS2017_Cpp_DirectX11.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x86_VS2017_Cpp_DirectX11.exe.sarif index 785ff3674..dfceadae3 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x86_VS2017_Cpp_DirectX11.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Uwp_x86_VS2017_Cpp_DirectX11.exe.sarif @@ -77,10 +77,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 3, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Uwp_x86_VS2017_Cpp_DirectX11.exe", + "EnableShadowStack", + "image is a native UWP (Universal Windows Platform) binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Uwp_x86_VS2017_Cpp_DirectX11.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 4, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -102,7 +126,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 4, + "ruleIndex": 5, "kind": "notApplicable", "level": "none", "message": { @@ -126,7 +150,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 5, + "ruleIndex": 6, "kind": "notApplicable", "level": "none", "message": { @@ -150,7 +174,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 6, + "ruleIndex": 7, "kind": "notApplicable", "level": "none", "message": { @@ -174,7 +198,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 7, + "ruleIndex": 8, "kind": "notApplicable", "level": "none", "message": { @@ -198,7 +222,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 8, + "ruleIndex": 9, "kind": "notApplicable", "level": "none", "message": { @@ -222,7 +246,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 9, + "ruleIndex": 10, "kind": "notApplicable", "level": "none", "message": { @@ -246,7 +270,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 10, + "ruleIndex": 11, "kind": "notApplicable", "level": "none", "message": { @@ -270,7 +294,7 @@ }, { "ruleId": "BA2002", - "ruleIndex": 11, + "ruleIndex": 12, "kind": "pass", "level": "none", "message": { @@ -292,7 +316,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 12, + "ruleIndex": 13, "message": { "id": "Warning_NativeWithInsecureStaticLibraryCompilands", "arguments": [ @@ -313,7 +337,7 @@ }, { "ruleId": "BA2004", - "ruleIndex": 12, + "ruleIndex": 13, "level": "error", "message": { "id": "Error_NativeWithInsecureDirectCompilands", @@ -335,7 +359,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "pass", "level": "none", "message": { @@ -357,7 +381,7 @@ }, { "ruleId": "BA2006", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "pass", "level": "none", "message": { @@ -380,7 +404,7 @@ }, { "ruleId": "BA2007", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "pass", "level": "none", "message": { @@ -403,7 +427,7 @@ }, { "ruleId": "BA2008", - "ruleIndex": 16, + "ruleIndex": 17, "level": "error", "message": { "id": "Error", @@ -424,7 +448,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "pass", "level": "none", "message": { @@ -446,7 +470,7 @@ }, { "ruleId": "BA2010", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "pass", "level": "none", "message": { @@ -468,7 +492,7 @@ }, { "ruleId": "BA2011", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "pass", "level": "none", "message": { @@ -490,7 +514,7 @@ }, { "ruleId": "BA2012", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -512,7 +536,7 @@ }, { "ruleId": "BA2013", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA2014", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -556,7 +580,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -578,7 +602,7 @@ }, { "ruleId": "BA2018", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -600,7 +624,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -622,7 +646,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -644,7 +668,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -759,14 +783,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Wix_3.11.1_VS2017_Bootstrapper.exe.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Wix_3.11.1_VS2017_Bootstrapper.exe.sarif index 3f88da9ba..2f4d100d3 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Wix_3.11.1_VS2017_Bootstrapper.exe.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/Wix_3.11.1_VS2017_Bootstrapper.exe.sarif @@ -269,10 +269,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 11, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "Wix_3.11.1_VS2017_Bootstrapper.exe", + "EnableShadowStack", + "image appears to be a WiX bootstrapper application" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Wix_3.11.1_VS2017_Bootstrapper.exe", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 12, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -294,7 +318,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 12, + "ruleIndex": 13, "kind": "notApplicable", "level": "none", "message": { @@ -318,7 +342,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 13, + "ruleIndex": 14, "kind": "notApplicable", "level": "none", "message": { @@ -342,7 +366,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 14, + "ruleIndex": 15, "kind": "notApplicable", "level": "none", "message": { @@ -366,7 +390,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 15, + "ruleIndex": 16, "kind": "notApplicable", "level": "none", "message": { @@ -390,7 +414,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 16, + "ruleIndex": 17, "kind": "notApplicable", "level": "none", "message": { @@ -414,7 +438,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 17, + "ruleIndex": 18, "kind": "notApplicable", "level": "none", "message": { @@ -438,7 +462,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 18, + "ruleIndex": 19, "kind": "notApplicable", "level": "none", "message": { @@ -462,7 +486,7 @@ }, { "ruleId": "BA2005", - "ruleIndex": 19, + "ruleIndex": 20, "kind": "pass", "level": "none", "message": { @@ -484,7 +508,7 @@ }, { "ruleId": "BA2009", - "ruleIndex": 20, + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -506,7 +530,7 @@ }, { "ruleId": "BA2010", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -528,7 +552,7 @@ }, { "ruleId": "BA2012", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -550,7 +574,7 @@ }, { "ruleId": "BA2016", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -572,7 +596,7 @@ }, { "ruleId": "BA2018", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -594,7 +618,7 @@ }, { "ruleId": "BA2019", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -616,7 +640,7 @@ }, { "ruleId": "BA2021", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -638,7 +662,7 @@ }, { "ruleId": "BA2022", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "notApplicable", "level": "none", "message": { @@ -977,14 +1001,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.default_compilation.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.default_compilation.sarif index ac416d2be..eec6a578b 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.default_compilation.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.default_compilation.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.default_compilation", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.default_compilation", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error", @@ -555,7 +579,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -577,7 +601,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -598,7 +622,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -620,7 +644,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1208,6 +1232,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1261,11 +1307,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.execstack.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.execstack.sarif index 30718e226..5cbb53cb4 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.execstack.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.execstack.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.execstack", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.execstack", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error", @@ -555,7 +579,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "level": "error", "message": { "id": "Error_StackExec", @@ -576,7 +600,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -597,7 +621,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -619,7 +643,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1207,6 +1231,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1260,11 +1306,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.execstack.so.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.execstack.so.sarif index 3f76bb65e..a03ff1395 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.execstack.so.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.execstack.so.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.execstack.so", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.execstack.so", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -556,7 +580,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "level": "error", "message": { "id": "Error_StackExec", @@ -577,7 +601,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -598,7 +622,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -620,7 +644,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1208,6 +1232,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1261,11 +1307,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.immediate_binding.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.immediate_binding.sarif index d0cc74951..89251f76c 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.immediate_binding.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.immediate_binding.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.immediate_binding", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.immediate_binding", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error", @@ -555,7 +579,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -577,7 +601,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -598,7 +622,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -620,7 +644,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -1209,6 +1233,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1262,11 +1308,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.no_immediate_binding.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.no_immediate_binding.sarif index 3750eb22e..850b07b00 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.no_immediate_binding.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.no_immediate_binding.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.no_immediate_binding", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.no_immediate_binding", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error", @@ -555,7 +579,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -577,7 +601,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -598,7 +622,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -620,7 +644,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1208,6 +1232,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1261,11 +1307,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.no_stack_protector.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.no_stack_protector.sarif index bd3e306cb..b0586af53 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.no_stack_protector.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.no_stack_protector.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.no_stack_protector", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.no_stack_protector", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error", @@ -555,7 +579,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -577,7 +601,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -598,7 +622,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -620,7 +644,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1208,6 +1232,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1261,11 +1307,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.noexecstack.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.noexecstack.sarif index e985ef9d9..48b2d2def 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.noexecstack.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.noexecstack.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.noexecstack", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.noexecstack", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error", @@ -555,7 +579,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -577,7 +601,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -598,7 +622,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -620,7 +644,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1208,6 +1232,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1261,11 +1307,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.noexecstack.so.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.noexecstack.so.sarif index cda2296ca..a4c493771 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.noexecstack.so.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.noexecstack.so.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.noexecstack.so", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.noexecstack.so", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -556,7 +580,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -578,7 +602,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -599,7 +623,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -621,7 +645,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1209,6 +1233,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1262,11 +1308,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.non_pie_executable.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.non_pie_executable.sarif index 80634043b..96d071288 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.non_pie_executable.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.non_pie_executable.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.non_pie_executable", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.non_pie_executable", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error", @@ -555,7 +579,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -577,7 +601,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -598,7 +622,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -620,7 +644,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1208,6 +1232,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1261,11 +1307,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.object_file.o.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.object_file.o.sarif index 80c353b4b..0a245274a 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.object_file.o.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.object_file.o.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.object_file.o", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.object_file.o", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "notApplicable", "level": "none", "message": { @@ -558,7 +582,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "notApplicable", "level": "none", "message": { @@ -582,7 +606,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "notApplicable", "level": "none", "message": { @@ -606,7 +630,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "notApplicable", "level": "none", "message": { @@ -630,7 +654,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "notApplicable", "level": "none", "message": { @@ -1221,14 +1245,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.pie_executable.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.pie_executable.sarif index 57a5b5976..336df7039 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.pie_executable.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.pie_executable.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.pie_executable", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.pie_executable", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -556,7 +580,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -578,7 +602,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -599,7 +623,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -621,7 +645,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1209,6 +1233,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1262,11 +1308,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.relocationsro.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.relocationsro.sarif index 830330415..6bcc46f9d 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.relocationsro.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.relocationsro.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.relocationsro", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.relocationsro", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error", @@ -555,7 +579,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -577,7 +601,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -598,7 +622,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -620,7 +644,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1208,6 +1232,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1261,11 +1307,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.relocationsrw.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.relocationsrw.sarif index d120253e9..c4c896e99 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.relocationsrw.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.relocationsrw.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.relocationsrw", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.relocationsrw", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error", @@ -555,7 +579,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -577,7 +601,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -598,7 +622,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -619,7 +643,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1207,6 +1231,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1260,11 +1306,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.shared_library.so.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.shared_library.so.sarif index b15d4347e..1c830b650 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.shared_library.so.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.shared_library.so.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.shared_library.so", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.shared_library.so", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -556,7 +580,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -578,7 +602,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -599,7 +623,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -621,7 +645,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1209,6 +1233,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1262,11 +1308,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.stack_protector.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.stack_protector.sarif index a9a02a128..5ff7e829d 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.stack_protector.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.stack_protector.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.stack_protector", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.stack_protector", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error", @@ -555,7 +579,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -577,7 +601,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -599,7 +623,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -621,7 +645,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1209,6 +1233,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1262,11 +1308,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.stack_protector.so.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.stack_protector.so.sarif index 4137c887f..0c30e836a 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.stack_protector.so.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/clang.stack_protector.so.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "clang.stack_protector.so", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/clang.stack_protector.so", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -556,7 +580,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -578,7 +602,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -600,7 +624,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -622,7 +646,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1210,6 +1234,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1263,11 +1309,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.default_compilation.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.default_compilation.sarif index 88b829816..de81f85af 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.default_compilation.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.default_compilation.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.default_compilation", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.default_compilation", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "level": "error", "message": { "id": "Error", @@ -531,7 +555,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -553,7 +577,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -575,7 +599,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -597,7 +621,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -618,7 +642,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1206,6 +1230,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1231,11 +1277,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.execstack.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.execstack.sarif index 5917aa0b1..4d3cdd285 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.execstack.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.execstack.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.execstack", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.execstack", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "level": "error", "message": { "id": "Error", @@ -531,7 +555,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error_StackExec", @@ -552,7 +576,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -574,7 +598,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -596,7 +620,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -617,7 +641,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1205,6 +1229,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1230,11 +1276,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.execstack.so.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.execstack.so.sarif index 586db3056..b38da6403 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.execstack.so.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.execstack.so.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.execstack.so", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.execstack.so", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -532,7 +556,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error_StackExec", @@ -553,7 +577,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -575,7 +599,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -597,7 +621,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -618,7 +642,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1206,6 +1230,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1231,11 +1277,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.fortified.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.fortified.sarif index fd707d083..95cfe004f 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.fortified.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.fortified.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.fortified", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.fortified", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "level": "error", "message": { "id": "Error", @@ -531,7 +555,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -553,7 +577,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -575,7 +599,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -597,7 +621,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -618,7 +642,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -1207,6 +1231,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1232,11 +1278,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.helloworld.4.o.no-stack-clash-protection.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.helloworld.4.o.no-stack-clash-protection.sarif index c8790a053..c61b9a27d 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.helloworld.4.o.no-stack-clash-protection.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.helloworld.4.o.no-stack-clash-protection.sarif @@ -485,8 +485,32 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 20, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.helloworld.4.o.no-stack-clash-protection", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.helloworld.4.o.no-stack-clash-protection", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -508,7 +532,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -530,7 +554,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error", @@ -551,7 +575,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 23, + "ruleIndex": 24, "level": "error", "message": { "id": "Error", @@ -573,7 +597,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -594,7 +618,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -616,7 +640,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -638,7 +662,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "pass", "level": "none", "message": { @@ -1227,14 +1251,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.helloworld.5.o.no-stack-clash-protection.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.helloworld.5.o.no-stack-clash-protection.sarif index bf755723b..3f840b5ec 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.helloworld.5.o.no-stack-clash-protection.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.helloworld.5.o.no-stack-clash-protection.sarif @@ -485,8 +485,32 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 20, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.helloworld.5.o.no-stack-clash-protection", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.helloworld.5.o.no-stack-clash-protection", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -508,7 +532,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -530,7 +554,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error", @@ -551,7 +575,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -574,7 +598,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -595,7 +619,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -617,7 +641,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -639,7 +663,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "pass", "level": "none", "message": { @@ -1228,14 +1252,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.helloworld.nodwarf.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.helloworld.nodwarf.sarif index 3567d82f1..c8f7903d0 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.helloworld.nodwarf.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.helloworld.nodwarf.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.helloworld.nodwarf", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.helloworld.nodwarf", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -532,7 +556,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -554,7 +578,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "level": "error", "message": { "id": "Error", @@ -575,7 +599,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -597,7 +621,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -619,7 +643,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -1208,6 +1232,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1233,11 +1279,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.immediate_binding.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.immediate_binding.sarif index 7b383fe7a..876d87e5f 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.immediate_binding.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.immediate_binding.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.immediate_binding", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.immediate_binding", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "level": "error", "message": { "id": "Error", @@ -531,7 +555,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -553,7 +577,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -575,7 +599,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -597,7 +621,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -619,7 +643,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1207,6 +1231,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1232,11 +1278,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.no_fortification_required.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.no_fortification_required.sarif index 8863842c7..6129642a5 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.no_fortification_required.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.no_fortification_required.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.no_fortification_required", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.no_fortification_required", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "level": "error", "message": { "id": "Error", @@ -531,7 +555,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -553,7 +577,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "level": "error", "message": { "id": "Error", @@ -574,7 +598,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -596,7 +620,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -617,7 +641,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -1206,6 +1230,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1231,11 +1277,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.no_immediate_binding.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.no_immediate_binding.sarif index 39a6ad58c..8b4e5be1f 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.no_immediate_binding.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.no_immediate_binding.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.no_immediate_binding", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.no_immediate_binding", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "level": "error", "message": { "id": "Error", @@ -531,7 +555,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -553,7 +577,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -575,7 +599,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -597,7 +621,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -618,7 +642,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1206,6 +1230,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1231,11 +1277,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.no_stack_protector.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.no_stack_protector.sarif index 00e4d02c3..b081a9b24 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.no_stack_protector.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.no_stack_protector.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.no_stack_protector", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.no_stack_protector", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "level": "error", "message": { "id": "Error", @@ -531,7 +555,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -553,7 +577,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "level": "error", "message": { "id": "Error", @@ -574,7 +598,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -596,7 +620,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -617,7 +641,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1205,6 +1229,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1230,11 +1276,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.noexecstack.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.noexecstack.sarif index a6de3c819..5a3814ac3 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.noexecstack.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.noexecstack.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.noexecstack", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.noexecstack", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "level": "error", "message": { "id": "Error", @@ -531,7 +555,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -553,7 +577,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -575,7 +599,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -597,7 +621,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -618,7 +642,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1206,6 +1230,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1231,11 +1277,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.noexecstack.so.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.noexecstack.so.sarif index e169987b7..85bc654e2 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.noexecstack.so.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.noexecstack.so.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.noexecstack.so", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.noexecstack.so", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -532,7 +556,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -554,7 +578,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -576,7 +600,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -598,7 +622,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -619,7 +643,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1207,6 +1231,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1232,11 +1278,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.non_pie_executable.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.non_pie_executable.sarif index 63b222ca7..e06524e31 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.non_pie_executable.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.non_pie_executable.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.non_pie_executable", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.non_pie_executable", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "level": "error", "message": { "id": "Error", @@ -531,7 +555,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -553,7 +577,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -575,7 +599,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -597,7 +621,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -618,7 +642,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1206,6 +1230,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1231,11 +1277,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.object_file.o.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.object_file.o.sarif index fd9ccb0ec..0833eb1a9 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.object_file.o.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.object_file.o.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.object_file.o", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.object_file.o", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "notApplicable", "level": "none", "message": { @@ -534,7 +558,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "notApplicable", "level": "none", "message": { @@ -558,7 +582,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "notApplicable", "level": "none", "message": { @@ -582,7 +606,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "notApplicable", "level": "none", "message": { @@ -606,7 +630,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "notApplicable", "level": "none", "message": { @@ -630,7 +654,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "notApplicable", "level": "none", "message": { @@ -1221,14 +1245,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.pie_executable.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.pie_executable.sarif index 873b65863..f005d561d 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.pie_executable.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.pie_executable.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.pie_executable", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.pie_executable", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -532,7 +556,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -554,7 +578,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -576,7 +600,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -598,7 +622,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -619,7 +643,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1207,6 +1231,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1232,11 +1278,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.relocationsro.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.relocationsro.sarif index b541a5326..bca9bfeba 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.relocationsro.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.relocationsro.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.relocationsro", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.relocationsro", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "level": "error", "message": { "id": "Error", @@ -531,7 +555,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -553,7 +577,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -575,7 +599,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -597,7 +621,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -618,7 +642,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1206,6 +1230,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1231,11 +1277,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.relocationsrw.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.relocationsrw.sarif index 5e3a3f9db..981a94409 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.relocationsrw.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.relocationsrw.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.relocationsrw", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.relocationsrw", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "level": "error", "message": { "id": "Error", @@ -531,7 +555,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -553,7 +577,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -575,7 +599,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "level": "error", "message": { "id": "Error", @@ -596,7 +620,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -617,7 +641,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1205,6 +1229,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1230,11 +1276,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.requiredsymbol.4.o.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.requiredsymbol.4.o.sarif index 4b74b3425..57b5ec774 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.requiredsymbol.4.o.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.requiredsymbol.4.o.sarif @@ -485,8 +485,32 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 20, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.requiredsymbol.4.o", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.requiredsymbol.4.o", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -508,7 +532,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -530,7 +554,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error", @@ -551,7 +575,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 23, + "ruleIndex": 24, "level": "error", "message": { "id": "Error", @@ -573,7 +597,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -595,7 +619,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -617,7 +641,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -639,7 +663,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "pass", "level": "none", "message": { @@ -1228,14 +1252,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.requiredsymbol.5.o.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.requiredsymbol.5.o.sarif index caeb2db0f..f2689338c 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.requiredsymbol.5.o.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.requiredsymbol.5.o.sarif @@ -485,8 +485,32 @@ ] }, { - "ruleId": "BA3001", + "ruleId": "BA2025", "ruleIndex": 20, + "kind": "notApplicable", + "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.requiredsymbol.5.o", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.requiredsymbol.5.o", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3001", + "ruleIndex": 21, "kind": "pass", "level": "none", "message": { @@ -508,7 +532,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -530,7 +554,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 22, + "ruleIndex": 23, "level": "error", "message": { "id": "Error", @@ -551,7 +575,7 @@ }, { "ruleId": "BA3004", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -574,7 +598,7 @@ }, { "ruleId": "BA3005", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -596,7 +620,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 25, + "ruleIndex": 26, "kind": "pass", "level": "none", "message": { @@ -618,7 +642,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 26, + "ruleIndex": 27, "kind": "pass", "level": "none", "message": { @@ -640,7 +664,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 27, + "ruleIndex": 28, "kind": "pass", "level": "none", "message": { @@ -1229,14 +1253,36 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.shared_library.so.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.shared_library.so.sarif index caeb44126..3fa4534e5 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.shared_library.so.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.shared_library.so.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.shared_library.so", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.shared_library.so", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -532,7 +556,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -554,7 +578,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -576,7 +600,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -598,7 +622,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -619,7 +643,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1207,6 +1231,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1232,11 +1278,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.stack_protector.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.stack_protector.sarif index 91adde7e1..262ed91a8 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.stack_protector.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.stack_protector.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.stack_protector", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.stack_protector", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "level": "error", "message": { "id": "Error", @@ -531,7 +555,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -553,7 +577,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -575,7 +599,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -597,7 +621,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -618,7 +642,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1206,6 +1230,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1231,11 +1277,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.stack_protector.so.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.stack_protector.so.sarif index 2d0b3e38e..f7582bd05 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.stack_protector.so.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.stack_protector.so.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.stack_protector.so", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.stack_protector.so", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "kind": "pass", "level": "none", "message": { @@ -532,7 +556,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -554,7 +578,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -576,7 +600,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -598,7 +622,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -619,7 +643,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1207,6 +1231,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1232,11 +1278,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.unfortified.sarif b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.unfortified.sarif index 853bc63bc..8c444a0a4 100644 --- a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.unfortified.sarif +++ b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Expected/gcc.unfortified.sarif @@ -485,10 +485,34 @@ ] }, { - "ruleId": "BA3005", + "ruleId": "BA2025", "ruleIndex": 20, "kind": "notApplicable", "level": "none", + "message": { + "id": "NotApplicable_InvalidMetadata", + "arguments": [ + "gcc.unfortified", + "EnableShadowStack", + "image is not a PE binary" + ] + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///Z:/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/gcc.unfortified", + "index": 0 + } + } + } + ] + }, + { + "ruleId": "BA3005", + "ruleIndex": 21, + "kind": "notApplicable", + "level": "none", "message": { "id": "NotApplicable_InvalidMetadata", "arguments": [ @@ -510,7 +534,7 @@ }, { "ruleId": "BA3001", - "ruleIndex": 21, + "ruleIndex": 22, "level": "error", "message": { "id": "Error", @@ -531,7 +555,7 @@ }, { "ruleId": "BA3002", - "ruleIndex": 22, + "ruleIndex": 23, "kind": "pass", "level": "none", "message": { @@ -553,7 +577,7 @@ }, { "ruleId": "BA3003", - "ruleIndex": 23, + "ruleIndex": 24, "kind": "pass", "level": "none", "message": { @@ -575,7 +599,7 @@ }, { "ruleId": "BA3010", - "ruleIndex": 24, + "ruleIndex": 25, "kind": "pass", "level": "none", "message": { @@ -597,7 +621,7 @@ }, { "ruleId": "BA3011", - "ruleIndex": 25, + "ruleIndex": 26, "level": "error", "message": { "id": "Error", @@ -618,7 +642,7 @@ }, { "ruleId": "BA3030", - "ruleIndex": 26, + "ruleIndex": 27, "level": "error", "message": { "id": "Error", @@ -1206,6 +1230,28 @@ }, "name": "EnableSpectreMitigations" }, + { + "id": "BA2025", + "fullDescription": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA2025EnableShadowStack", + "help": { + "text": "Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature that provides capabilities to defend against return-oriented programming (ROP) based malware attacks." + }, + "messageStrings": { + "Pass": { + "text": "'{0}' enables the Control-flow Enforcement Technology (CET) Shadow Stack mitigation." + }, + "Warning": { + "text": "'{0}' does not enable the Control-flow Enforcement Technology (CET) Shadow Stack mitigation. To resolve this issue, pass /CETCOMPAT on the linker command lines." + }, + "NotApplicable_InvalidMetadata": { + "text": "'{0}' was not evaluated for check '{1}' as the analysis is not relevant based on observed metadata: {2}." + } + }, + "name": "EnableShadowStack" + }, { "id": "BA3005", "fullDescription": { @@ -1231,11 +1277,11 @@ { "id": "BA3001", "fullDescription": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "helpUri": "https://github.com/microsoft/binskim/blob/main/docs/BinSkimRules.md#rule-BA3001EnablePositionIndependentExecutable", "help": { - "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." + "text": "A Position Independent Executable (PIE) relocates all of its sections at load time, including the code section, if ASLR is enabled in the Linux kernel (instead of just the stack/heap). This makes ROP-style attacks more difficult. This can be enabled by passing '-f pie' to clang/gcc." }, "messageStrings": { "Pass_Executable": { diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe new file mode 100644 index 000000000..72fa78634 Binary files /dev/null and b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.exe differ diff --git a/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.pdb b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.pdb new file mode 100644 index 000000000..1c81b68fb Binary files /dev/null and b/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData/Native_x64_CETShadowStack_Enabled.pdb differ diff --git a/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Fail/Native_x64_CETShadowStack_Disabled.exe b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Fail/Native_x64_CETShadowStack_Disabled.exe new file mode 100644 index 000000000..eda9b070b Binary files /dev/null and b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Fail/Native_x64_CETShadowStack_Disabled.exe differ diff --git a/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Fail/Native_x64_CETShadowStack_Disabled.pdb b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Fail/Native_x64_CETShadowStack_Disabled.pdb new file mode 100644 index 000000000..3b7c40471 Binary files /dev/null and b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Fail/Native_x64_CETShadowStack_Disabled.pdb differ diff --git a/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Fail/Native_x64_CETShadowStack_NotEnabled.exe b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Fail/Native_x64_CETShadowStack_NotEnabled.exe new file mode 100644 index 000000000..407dcbb17 Binary files /dev/null and b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Fail/Native_x64_CETShadowStack_NotEnabled.exe differ diff --git a/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Fail/Native_x64_CETShadowStack_NotEnabled.pdb b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Fail/Native_x64_CETShadowStack_NotEnabled.pdb new file mode 100644 index 000000000..e89d18927 Binary files /dev/null and b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Fail/Native_x64_CETShadowStack_NotEnabled.pdb differ diff --git a/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Pass/Native_x64_CETShadowStack_Enabled.exe b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Pass/Native_x64_CETShadowStack_Enabled.exe new file mode 100644 index 000000000..72fa78634 Binary files /dev/null and b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Pass/Native_x64_CETShadowStack_Enabled.exe differ diff --git a/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Pass/Native_x64_CETShadowStack_Enabled.pdb b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Pass/Native_x64_CETShadowStack_Enabled.pdb new file mode 100644 index 000000000..1c81b68fb Binary files /dev/null and b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Pass/Native_x64_CETShadowStack_Enabled.pdb differ diff --git a/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Pass/Native_x86_CETShadowStack_Enabled.dll b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Pass/Native_x86_CETShadowStack_Enabled.dll new file mode 100644 index 000000000..b0348b60c Binary files /dev/null and b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Pass/Native_x86_CETShadowStack_Enabled.dll differ diff --git a/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Pass/Native_x86_CETShadowStack_Enabled.pdb b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Pass/Native_x86_CETShadowStack_Enabled.pdb new file mode 100644 index 000000000..7a53fb27a Binary files /dev/null and b/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData/BA2025.EnableShadowStack/Pass/Native_x86_CETShadowStack_Enabled.pdb differ diff --git a/src/Test.FunctionalTests.BinSkim.Rules/RuleTests.cs b/src/Test.FunctionalTests.BinSkim.Rules/RuleTests.cs index bf33318fa..6cd1df53c 100644 --- a/src/Test.FunctionalTests.BinSkim.Rules/RuleTests.cs +++ b/src/Test.FunctionalTests.BinSkim.Rules/RuleTests.cs @@ -1095,6 +1095,24 @@ public void BA2024_EnableSpectreMitigations_Fail() } } + [Fact] + public void BA2025_EnableShadowStack_Pass() + { + if (BinaryParsers.PlatformSpecificHelpers.RunningOnWindows()) + { + this.VerifyPass(new EnableShadowStack(), useDefaultPolicy: true); + } + } + + [Fact] + public void BA2025_EnableShadowStack_Fail() + { + if (BinaryParsers.PlatformSpecificHelpers.RunningOnWindows()) + { + this.VerifyFail(new EnableShadowStack(), useDefaultPolicy: true); + } + } + [Fact] public void BA3001_EnablePositionIndependentExecutable_Pass() {