Skip to content

Commit ee5513b

Browse files
Jeckelmann ManuelJeckelmann Manuel
authored andcommitted
Fix commitHash confusion; Instead of the previous' commit's hash (which is the more recent commit), the current commit's hash value was returned, effectively pointing the parent commit instead of the one including sensitive data
1 parent 1760c0a commit ee5513b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

truffleHog/truffleHog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def find_entropy(printableDiff, commit_time, branch_name, prev_commit, blob, com
183183
entropicDiff['diff'] = blob.diff.decode('utf-8', errors='replace')
184184
entropicDiff['stringsFound'] = stringsFound
185185
entropicDiff['printDiff'] = printableDiff
186-
entropicDiff['commitHash'] = commitHash
186+
entropicDiff['commitHash'] = prev_commit.hexsha
187187
entropicDiff['reason'] = "High Entropy"
188188
return entropicDiff
189189

@@ -207,7 +207,7 @@ def regex_check(printableDiff, commit_time, branch_name, prev_commit, blob, comm
207207
foundRegex['stringsFound'] = found_strings
208208
foundRegex['printDiff'] = found_diff
209209
foundRegex['reason'] = key
210-
foundRegex['commitHash'] = commitHash
210+
foundRegex['commitHash'] = prev_commit.hexsha
211211
regex_matches.append(foundRegex)
212212
return regex_matches
213213

0 commit comments

Comments
 (0)