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

🐛 Trufflehog3: Remove null characters #9470

Merged
merged 1 commit into from
Feb 6, 2024
Merged
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
2 changes: 1 addition & 1 deletion dojo/tools/trufflehog3/parser.py
Original file line number Diff line number Diff line change
@@ -156,7 +156,7 @@ def get_finding_current(self, json_data, test, dupes):
title=title,
test=test,
cwe=798,
description=description,
description=description.replace("\x00", "\uFFFD"),
severity=severity,
mitigation="Secrets and passwords should be stored in a secure vault or secure storage.",
impact="This weakness can lead to the exposure of resources or functionality to unintended actors, possibly providing attackers with sensitive information or even execute arbitrary code.",
21 changes: 21 additions & 0 deletions unittests/scans/trufflehog3/issue_6999.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions unittests/tools/test_trufflehog3_parser.py
Original file line number Diff line number Diff line change
@@ -99,3 +99,9 @@ def test_many_vulns_current(self):
self.assertEqual('env-file.txt', finding.file_path)
self.assertEqual(10, finding.line)
self.assertEqual(1, finding.nb_occurences)

def test_issue_6999(self):
test_file = open(sample_path("issue_6999.json"))
parser = TruffleHog3Parser()
findings = parser.get_findings(test_file, Test())
self.assertEqual(len(findings), 1)