diff --git a/dojo/tools/semgrep/parser.py b/dojo/tools/semgrep/parser.py index 39f72f8b431..83eb200a368 100644 --- a/dojo/tools/semgrep/parser.py +++ b/dojo/tools/semgrep/parser.py @@ -35,6 +35,10 @@ def get_findings(self, filename, test): # fingerprint detection unique_id_from_tool = item.get("extra", {}).get("fingerprint") + # treat "requires login" as if the fingerprint is absent + if unique_id_from_tool == "requires login": + unique_id_from_tool = None + if unique_id_from_tool: finding.unique_id_from_tool = unique_id_from_tool @@ -99,6 +103,10 @@ def get_findings(self, filename, test): # fingerprint detection unique_id_from_tool = item.get("extra", {}).get("fingerprint") + # treat "requires login" as if the fingerprint is absent + if unique_id_from_tool == "requires login": + unique_id_from_tool = None + if unique_id_from_tool: finding.unique_id_from_tool = unique_id_from_tool @@ -149,6 +157,9 @@ def get_description(self, item): description += f"**Result message:** {message}\n" snippet = item["extra"].get("lines") + if snippet == "requires login": + snippet = None # Treat "requires login" as no snippet + if snippet is not None: if "