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

Add test data for node.Js report #136

Merged
merged 5 commits into from
May 4, 2019
Merged

Add test data for node.Js report #136

merged 5 commits into from
May 4, 2019

Conversation

thib3113
Copy link
Contributor

Following this issue #135 I'm adding some tests datas

@Reamer
Copy link
Member

Reamer commented Apr 24, 2019

Hi @thib3113
this is quite interesting, it seems that vulnerabilities found via NPM have no cvss score. (Take a look into comment jeremylong/DependencyCheck#1366 (comment))
What would be a good solution for this case?
Ignoring NPM vulnerabilities or set a default score (0-10).

@Reamer
Copy link
Member

Reamer commented Apr 24, 2019

Please pretty print your big xml file. Possible tools: https://stackoverflow.com/questions/16090869/how-to-pretty-print-xml-from-the-command-line

@thib3113
Copy link
Contributor Author

About the big file, I've just add it to show how big can become a node.js analysis . So just adding this to test an "unmodified" report . But I can pretty print it without problems ( but tomorrow ) .

About the npm part, I know npm audit return a vulnerability level ( telling if vulnerability is important, medium or low ), so it's will maybe be updated in dependency check tool ( node.js analyser is buggy some times, and show really lot of warnings ) . So, for the moment, set it to middle score by default ? To tell it's not a low vulnerability, and not a high vulnerability, just unknown level.

I'll read your link tomorrow too .

@thib3113
Copy link
Contributor Author

thib3113 commented Apr 25, 2019

So, after some research, it seems the version 5.0.0-SNAPSHOT ( directly from the git, with commit jeremylong/DependencyCheck@c747bac ) , seems to produce this in the xml :

<vulnerability source="NPM">
    <name>786</name>
    <severity>low</severity>
    <cwes/>
    <description>
        Versions of `braces` prior to 2.3.1 are vulnerable to Regular Expression Denial of Service (ReDoS). Untrusted input may cause catastrophic backtracking while matching regular expressions. This can cause the application to be unresponsive leading to Denial of Service.
    </description>
    <references>
        <reference>
            <source>Advisory 786: Regular Expression Denial of Service</source>
            <name>
                - [GitHub Commit](https://github.com/micromatch/braces/commit/abdafb0cae1e0c00f184abbadc692f4eaa98f451)
            </name>
        </reference>
    </references>
    <vulnerableSoftware>
        <software>cpe:2.3:a:*:braces:\&lt;2.3.1:*:*:*:*:*:*:*</software>
    </vulnerableSoftware>
</vulnerability>

As you can see, a severity node is added, with the level, but undocumented in the xsd ( I've open an issue jeremylong/DependencyCheck#1873 about it )

@Reamer
Copy link
Member

Reamer commented May 3, 2019

Hi @thib3113,
I added a small Workaround till dependency-check-5.0.0 is released. Please add some more asserts in your test method - in special the "workaround values". #141

@thib3113
Copy link
Contributor Author

thib3113 commented May 3, 2019

Hi @Reamer , here is it, I add more assertions, testing jquery, brace, and kind of ( jquery contain a NVD vulnerability, brace a NPM vulnerability, and kind-of without vulnerabilities ) .

( I'm not a java developper, so I didn't really know how to test only this 3 dependencies on the big report, so I've done 3 basics conditions )

@Reamer Reamer merged commit 4db4fbc into dependency-check:master May 4, 2019
@Reamer
Copy link
Member

Reamer commented May 4, 2019

All good, thanks for your work.

Reamer pushed a commit that referenced this pull request Jun 4, 2019
* Add test data for node.Js report
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants