Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving Nuget detectors to track packages being consumed. #85

Open
8Gitbrix opened this issue Mar 26, 2022 · 3 comments
Open

Improving Nuget detectors to track packages being consumed. #85

8Gitbrix opened this issue Mar 26, 2022 · 3 comments
Labels
detector:nuget The NuGet detector type:feature Feature (new functionality)

Comments

@8Gitbrix
Copy link
Member

8Gitbrix commented Mar 26, 2022

Per OSE support thread "MerlinBot doesn't read PackageReferences correctly?", they're wondering if the nuget detectors can be improved to only look at packages being consumed instead of looking at csproj files in isolation.

Interesting points from my conversation with Parker:

  • NET has assembly binding redirects that can be applied so that even if the app or a dependency asks for a vulnerable version, and Nuget downloads one, only non-vulnerable versions may be packaged or consumed
  • .NET Core can also do this, but with different settings and with and assets.jsons rather than packages.config.

Would it be possible to leverage something like this to improve our nuget detectors?

@8Gitbrix 8Gitbrix added detector:nuget The NuGet detector type:feature Feature (new functionality) labels Mar 26, 2022
@frankshearar
Copy link
Member

For example: project Sub contains something that transitively references a naughty package version. Sub is part of Super, some top level project (exe, Azure Cloud Service worker role, whatever). Super has a direct reference to the nice package version.

Sub gets flagged up as being vulnerable, even though it's not - because of the pin in Super. If you examined the DLLs in Super's bin/ you'd see the nice package version.

@8Gitbrix
Copy link
Member Author

8Gitbrix commented Apr 27, 2022

Adding some more info here after discussion on support issue "Re: Component Detection - System.Security.Cryptography.X509Certificates v4.1.0". The component causing the alert is in the nuget cache on the build machine, but not the one being packaged and shipped.

So we'd get more accurate info on the packages that are (the proper version for example) actually being consumed by checking the dll

@frankshearar
Copy link
Member

Checking the compiled DLL would definitely be more accurate. Binding redirects mean that you might have compiled against the vulnerable package version but not actually be using it. At least we'd cut down on false positives like that which resulted in this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
detector:nuget The NuGet detector type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

2 participants