-
Notifications
You must be signed in to change notification settings - Fork 481
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
Bypass any plugin with square brackets #857
Comments
So I found a workaround here. line = line.rstrip().replace("[", "\[").replace("]", "\]") I will open a PR if this works for you. |
tsigouris007
added a commit
to tsigouris007/detect-secrets
that referenced
this issue
Jun 20, 2024
4 tasks
Any improvements are more than welcome. |
tsigouris007
added a commit
to tsigouris007/detect-secrets
that referenced
this issue
Jul 16, 2024
tsigouris007
added a commit
to tsigouris007/detect-secrets
that referenced
this issue
Oct 1, 2024
tsigouris007
added a commit
to tsigouris007/detect-secrets
that referenced
this issue
Nov 7, 2024
tsigouris007
added a commit
to tsigouris007/detect-secrets
that referenced
this issue
Nov 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current behavior
A user is able to bypass the tool engine by using
[]
characters. This is also a security issue.Steps to reproduce
To reproduce you can use the following
config.rb
file as is (the secrets are dummy / generated values):Or raw without the line numbers:
Run:
~$ detect-secrets-hook --json config.rb
Output:
All
access_key_id
s andsecret_key
s should be caught.The tool missed lines 3, 4.
By using the
[]
characters all secrets seem to be missed. Tried on multiple plugins.Security bypass.
Environment:
Other information
I suspected file
detect_secrets/plugins/base.py
methodbuild_assignment_regex
variablesopt_open_square_bracket
andopt_close_square_bracket
and tried to solve locally with no success.I have a feeling that the
Generator
is problematic.Still analyzing the code and haven't pinpointed the exact location of the problem.
The text was updated successfully, but these errors were encountered: