Lighthouse: Add Remediation advice to each library vuln

Created on 11 Oct 2017  Â·  11Comments  Â·  Source: GoogleChrome/lighthouse

The no-vulnerable-libraries audit detects and lists security vulnerabilities, but is not able to be used "offline" because there is no remediation advice to go with the vulns.

This means we're not able to format lighthouse 'advice' or 'opportunities' as we do elsewhere.

Current output from no-vulnerable-libraries audit:

screen shot 2017-10-11 at 9 22 50 am

Information we don't have in the audit but need:

https snyk io partners api v2 vulndb clientside json 2017-10-11 09-57-42

Having the semver ranges would be useful, but we'd also need to know the current released version of a given library (Snyk vuln page):

cross-site scripting xss snyk 2017-10-11 09-27-46

If we can have the current released version of a given library added to the snyk client API, then I think we'll be able to do everything that we want.

Ping @tkadlec

P3 feature help wanted

Most helpful comment

I've asked a guy that works at Snyk for any help regarding getting that prop from the vuln db, but what I think we could do, is to add the fixedIn property from the vulnDB and use that to figure out which actions to take. That prop is already present in the vuln db, along with semver ranges for unaffected versions.

Edit: Fixed in is our source of truth. Has a prop that indicates what we should output disregarding semver ranges.

Should I go for that?

All 11 comments

Without explicit remediation advice in the JSON we can still do something similar. We can use the semver lib to interpret the affected version ranges. From that we can calculate the highest affected version.

That means we couldn't necessarily say "You need to upgrade to version 3 or higher" but we could say something like "You gotta upgrade this lib to a version over 2.6.1".

Good second/third bug here. :) @benschwarz you interested in taking this?

Yep. Leaving it on my list

@benschwarz if you're full I can take it

good

@benschwarz @evenstensberg any takers? :)

Could work on this in June. Wrapping up some other work first.

I'll take it

I've asked a guy that works at Snyk for any help regarding getting that prop from the vuln db, but what I think we could do, is to add the fixedIn property from the vulnDB and use that to figure out which actions to take. That prop is already present in the vuln db, along with semver ranges for unaffected versions.

Edit: Fixed in is our source of truth. Has a prop that indicates what we should output disregarding semver ranges.

Should I go for that?

Sounds great to me @evenstensberg! In fact, I actually think if we don't have any fixedIn value we shouldn't surface the vuln at all to prevent cases like #8409 #8748

Yup. @lirantal from snyk is following up on this

hey fellas, @evenstensberg @patrickhulce 👋
notice that we (@aviadatsnyk) added a fixedIn field to the clientside.json file we're sending you so you should be able to use that to get more insights out in terms of available fixed version.

Notice that to get the data you probably need to tweak the pruned data here to include it https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/scripts/cleanup-vuln-snapshot.js#L56 ?

Was this page helpful?
0 / 5 - 0 ratings