sonatype-nexus-community/DevAudit

Crash when detecting a nuget vulnerability in non-interactive mode

infocynic opened this issue · 9 comments

System: Windows 10 64-bit (1809)
Net Framework 4.8 installed

When I run DevAudit with nuget -n -d -f path.to\packages.config it detects some vulnerabilities and eventually crashes (see screenshot and attached packages.config (renamed to .txt); I've removed 4 private packages but otherwise it's identical).

If I remove the -n flag, it will complete, but I need to be able to run this in a CI context, so either I need the -n flag not to crash, or I need to pipe the output through something like grep/findstr, which I can't do without it crashing due to the known issue.

packages.config.txt

devaudit-crash

Hi sorry for responding late. What version of DevAudit are you using? (the version is at the top of devaudit --help). On my Win10 64bit it completes the audit of that file without errors.

Hi really sorry for taking so long to get back to you again. You can download the latest DevAudit builds for Windows from https://allisterb-devaudit.s3.us-east-2.amazonaws.com/DevAudit_Latest.zip Could you try this version and see if the problem persists.

OK so I got back around to this; the new version doesn't crash.... but it also always returns an exit code of 0, even if I use the ci parameter. I tried various combinations of ci and -n and can't get a non-zero error code even with the above package file, which is known to have errors.

As a workaround, I can pipe to findstr VULNERABLE and look for a zero exit code (zero indicates FINDSTR worked, so something IS vulnerable), but it's a little hacky.

This is probably a bug handling the ci parameter...I'll check it out.

Can't seem to reproduce this with the version from https://allisterb-devaudit.s3.us-east-2.amazonaws.com/DevAudit_Latest.zip
devaudit nuget -f "C:\Users\Allister\Downloads\packages.config (1).txt" --ci -n -d
echo %errorlevel%
13

Are you running devaudit via PowerShell or another kind of command shell?

The parameters using (-) are single character only so the CLI should throw an error if a multi-char string is used. I'll fix this too. Thanks for reporting these issues. We'll make an official build with the latest changes soon.

I am cleaning up older issues. A new build was pushed out a while ago. Things are running a bit slow at the moment, but I am finally getting older issues cleared out.