warn or info for similar looking advisory URLs #11
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
refs: #2 nodesecurity.io redirect and mozilla/fxa-profile-server#353 and related discussion on #fxa on IRC (job https://travis-ci.org/mozilla/fxa-profile-server/jobs/457024645).
Exit codes and filter matching would be unchanged, but when similar looking URLs show up in the audit JSON output we write to stderr something like:
and suggest that they check both URLs resolve to the same advisory.
We can define "similar looking URLs" to 1) contain the same advisory ID and 2) have one of more of the following be true:
nodesecurity.io
andnpmjs.com
http
andhttps
(also probably want to warn for http)www
subdomain e.g. fromnpmjs.com/advisories/
andwww.npmjs.com/advisories/
Unit tests would check that we make suggestions for:
https://nodesecurity.io/advisories/598
andhttps://npmjs.com/advisories/598
http://nodesecurity.io/advisories/598
vshttps://nodesecurity.io/advisories/598
https://npmjs.com/advisories/598
andhttps://www.npmjs.com/advisories/598
and no suggestion for other URLs.
The text was updated successfully, but these errors were encountered: