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

postgres add_discoveries broken for NUL characters #247

Open
marcorosa opened this issue Jul 8, 2022 · 0 comments
Open

postgres add_discoveries broken for NUL characters #247

marcorosa opened this issue Jul 8, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@marcorosa
Copy link
Member

During the scan, when adding discoveries via postgres, some discoveries may raise an exception

Traceback (most recent call last):                                               
  File "/Users/marco/git/credential-digger/venv/bin/credentialdigger", line 8, in <module>                                                                      
    sys.exit(main())                                                             
  File "/Users/marco/git/credential-digger/venv/lib/python3.9/site-packages/credentialdigger/__main__.py", line 7, in main                                      
    cli.main(sys.argv)                                                           
  File "/Users/marco/git/credential-digger/venv/lib/python3.9/site-packages/credentialdigger/cli/cli.py", line 145, in main                                     
    args.func(client, args)                                                      
  File "/Users/marco/git/credential-digger/venv/lib/python3.9/site-packages/credentialdigger/cli/scan.py", line 109, in run                                     
    discoveries = client.scan(                                                   
  File "/Users/marco/git/credential-digger/venv/lib/python3.9/site-packages/credentialdigger/client.py", line 794, in scan                                      
    return self._scan(                                                           
  File "/Users/marco/git/credential-digger/venv/lib/python3.9/site-packages/credentialdigger/client.py", line 1169, in _scan                                    
    new_id = self.add_discovery(                                                 
  File "/Users/marco/git/credential-digger/venv/lib/python3.9/site-packages/credentialdigger/client_postgres.py", line 95, in add_discovery                     
    return super().add_discovery(
  File "/Users/marco/git/credential-digger/venv/lib/python3.9/site-packages/credentialdigger/client.py", line 116, in add_discovery
    return self.query_id(
  File "/Users/marco/git/credential-digger/venv/lib/python3.9/site-packages/credentialdigger/client_postgres.py", line 57, in query_id
    cursor.execute(query, args)
ValueError: A string literal cannot contain NUL (0x00) characters.

Possible reason: the snippet may contain a character not supported

NB: verify if #246 (when solved) automatically fixes this bug

@marcorosa marcorosa added the bug Something isn't working label Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant