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

Dont yield all snyk findings when no version was found (1.17) #3533

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -486,5 +486,10 @@
"source": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers",
"impact": "Nonstandard headers may not be supported by all browsers and may not provide the security that is expected.",
"recommendation": "Remove the nonstandard headers from the response."
},
"KAT-SOFTWARE-VERSION-NOT-FOUND": {
"description": "The version of the software is not found.",
"risk": "recommendation",
"recommendation": "There was no version found for this software but there are known vulnerabilities for this software."
}
}
11 changes: 10 additions & 1 deletion boefjes/boefjes/plugins/kat_snyk/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def run(input_ooi: dict, raw: bytes) -> Iterable[NormalizerOutput]:
elif not results["table_vulnerabilities"] and not results["cve_vulnerabilities"]:
# no vulnerabilities found
return
else:
if software_version:
for vuln in results["table_vulnerabilities"]:
snyk_ft = SnykFindingType(id=vuln.get("Vuln_href"))
yield snyk_ft
Expand All @@ -40,6 +40,15 @@ def run(input_ooi: dict, raw: bytes) -> Iterable[NormalizerOutput]:
ooi=pk_ooi,
description=vuln.get("Vuln_text"),
)
if not software_version and (results["table_vulnerabilities"] or results["cve_vulnerabilities"]):
kat_ooi = KATFindingType(id="KAT-SOFTWARE-VERSION-NOT-FOUND")
yield kat_ooi
yield Finding(
finding_type=kat_ooi.reference,
ooi=pk_ooi,
description="There was no version found for this software. "
"But there are known vulnerabilities for some versions.",
)

# Check for latest version
latest_version = ""
Expand Down