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

Improved Telegram bot token rule regex and added more test cases #1404

Merged
merged 1 commit into from
Jun 1, 2024

Conversation

toxyl
Copy link
Contributor

@toxyl toxyl commented May 10, 2024

Description:

At work we came across an edge-case where the Telegram bot token rule would match lots of XML schema definitions in which clm12345:AgencyIdentificationCodeContentType appears which happens be the exact same length the regex is looking for (A[a-zA-Z0-9_\-]{34}) prefixed with the right amount of digits ([0-9]{5,16}) . To fix it I've modified the regex to take boundaries into account and simplified a-zA-Z0-9 parts to a-z0-9 because the entire regex is already case insensitive ((?i)). Also added a few more test cases.

Checklist:

  • Does your PR pass tests?
  • Have you written new tests for your changes?
  • Have you lint your code locally prior to submission?

@zricethezav zricethezav merged commit bb4424d into gitleaks:master Jun 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants