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

SkipFile is case-sensitive #2382

Closed
rgmz opened this issue Feb 5, 2024 · 1 comment · Fixed by #2383
Closed

SkipFile is case-sensitive #2382

rgmz opened this issue Feb 5, 2024 · 1 comment · Fixed by #2383
Labels

Comments

@rgmz
Copy link
Contributor

rgmz commented Feb 5, 2024

Please review the Community Note before submitting

TruffleHog Version

v3.67.1

Trace Output

2024-02-05T08:28:09-05:00	info-1	trufflehog	binary file not handled, chunking raw	{"path": "example.PNG"}
2024-02-05T08:28:09-05:00	info-1	trufflehog	binary file not handled, chunking raw	{"path": "example2.PNG"}

Expected Behavior

TruffleHog should ignore .png files.

Actual Behavior

TruffleHog scans PNG files if they have an uppercase extension (.PNG). The function SkipFile should use a case-insensitive comparison like string.EqualFold.

func SkipFile(filename string) bool {
for _, ext := range IgnoredExtensions {
if strings.TrimPrefix(filepath.Ext(filename), ".") == ext {
return true
}
}
return false
}

Steps to Reproduce

  1. Change the extension of a .png, or any other ignored file type, to uppercase.
  2. Scan the file.
  3. The file will be chunked instead of skipped.

Environment

N/A

Additional Context

N/A

References

N/A

@rgmz rgmz added the bug label Feb 5, 2024
@rgmz
Copy link
Contributor Author

rgmz commented Feb 5, 2024

Incidentally, bmp should be added t ignored files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant