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

DeprecationWarning: Flags not at the start of the expression #30

Open
hugonh opened this issue Nov 22, 2024 · 3 comments
Open

DeprecationWarning: Flags not at the start of the expression #30

hugonh opened this issue Nov 22, 2024 · 3 comments

Comments

@hugonh
Copy link

hugonh commented Nov 22, 2024

Hey!
I have an issue related with
DeprecationWarning: Flags not at the start of the expression 'xsmtpsib-[a-f0-9]{64' (truncated) but at position 23
DeprecationWarning: Flags not at the start of the expression 'SG\.(?i)[a-z0-9_\-\.' (truncated) but at position 4
DeprecationWarning: Flags not at the start of the expression 'PMAK-(?i)[a-f0-9]{24' (truncated) but at position 5

@spark1security
Copy link
Owner

Thanks for reporting it. Unfortunately I was not able to replicate the issue. Which version of Python are you using?

I tried to get the deprecation warnings using Python 3.11.9 and enabling the flag "-Wd", however I could not see the warnings. Could you please provide more details about your env and how you get teh warnings?

(venv) user@MacBook-Air n0s1 % python -Wd src/n0s1/n0s1.py linear_scan       
INFO:root:n0s1 secret scanner version [1.0.24] - Scan date: 2024-11-24T22:36:52
INFO:root:Logged to Linear as {'data': {'viewer': {'id': '59aba53d-9c62-426e-8416-3e9adf3bc202', 'name': '[email protected]', 'email': '[email protected]'}}}
INFO:root:Starting scan in community mode...
INFO:root:
Potential secret leak regex match!
INFO:root:Platform:[Linear] Field:[comments] ID:[AWS] Description:[AWS Access Token] Regex: \bAKIA[0-9A-Z]{16}\b
############## Sanitized Secret Leak ##############
  access key such as <REDACTED> ?
############## Sanitized Secret Leak ##############
INFO:root:
Leak source: https://linear.app/spark1/issue/SPA-9/next-steps
INFO:root:


INFO:root:Done!
(venv) user@MacBook-Air n0s1 % python --version
Python 3.11.9

@hugonh
Copy link
Author

hugonh commented Nov 25, 2024

command: python n0s1.py jira_scan --server "$url" --email "$email" --api-key "$key"
version: Python.3.9_3.9.3568.0_x64

@spark1security
Copy link
Owner

Thank you for providing further details. I think your version of Python does not like inline modifiers at the start of the string. Try moving the case-insensitive modifier to the beginning of the regexes. For instance:

 '(?i)SG\.[a-z0-9_\-\.'

rather than

'SG\.(?i)[a-z0-9_\-\.'

Your issue is probably the same as reported in this Stack Overflow discussion.

Please let me know if that solves your issue.

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

No branches or pull requests

2 participants