You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have some managed C++ DLLs flagged by BinSkim for BA2004, specifically for NativeWithInsecureStaticLibraryCompilands, even with /ZH:SHA_256 applied. Checking the binaries with cvtdump -sf, you can see the correct hashes for the native code, but references to managed assemblies with no hash details.
Looking at the implementation for BA2004 there's variability in whether object files will be flagged, depending on the order in which the sources show up:
// We only need to check a single source file per compiland, as the relevant
// command-line options will be applied to all files in the translation unit.
So the way I've found to make it repro more reliably, is to add explicit references like:
which seems to make the .NET assemblies show up first in the "sources".
The warning class has some hardcoded exclusions for expected toolset stuff we see in the dump, like "predefined C++ types (compiler internal)", but not possible managed references.
The text was updated successfully, but these errors were encountered:
We have some managed C++ DLLs flagged by BinSkim for BA2004, specifically for NativeWithInsecureStaticLibraryCompilands, even with /ZH:SHA_256 applied. Checking the binaries with cvtdump -sf, you can see the correct hashes for the native code, but references to managed assemblies with no hash details.
BA2004ManagedCppRepro.zip
Repro:
SARIF will report:
You can check
cvdump -sf x64\Release\BA2004ManagedCppRepro.dll
:Looking at the implementation for BA2004 there's variability in whether object files will be flagged, depending on the order in which the sources show up:
So the way I've found to make it repro more reliably, is to add explicit references like:
which seems to make the .NET assemblies show up first in the "sources".
The warning class has some hardcoded exclusions for expected toolset stuff we see in the dump, like "predefined C++ types (compiler internal)", but not possible managed references.
The text was updated successfully, but these errors were encountered: