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

jdbc url with just host and port triggers false alert #3856

Open
david-gang opened this issue Jan 28, 2025 · 1 comment
Open

jdbc url with just host and port triggers false alert #3856

david-gang opened this issue Jan 28, 2025 · 1 comment
Labels

Comments

@david-gang
Copy link

david-gang commented Jan 28, 2025

Please review the Community Note before submitting

TruffleHog Version

3.88.2

Trace Output

https://gist.github.com/david-gang/370f0b4ec43afe9a2bcd835c635a01fb

Expected Behavior

this is part of a local docker compose environment:

  flyway:
    image: flyway/flyway:10
    depends_on:
      - postgres
    command: migrate
    volumes:
      - ./flyway/sql:/flyway/sql
      - ./flyway/conf:/flyway/conf
    environment:
      FLYWAY_URL: jdbc:postgresql://postgres:5432/mydb
      FLYWAY_USER: postgres
      FLYWAY_PASSWORD: password
      FLYWAY_SCHEMAS: public
      FLYWAY_LOCATIONS: filesystem:/flyway/sql

Trufflehog shouldn't issue an error as i did not add here an username or password in the url

Actual Behavior

trufflehog fails with output

Found unverified result 🐷🔑❓
Verification issue: dial tcp: lookup postgres: no such host
dial tcp: lookup postgres: no such host
Detector Type: JDBC
Decoder Type: PLAIN
Raw result: jdbc:postgresql://postgres:5432/mydb
File: backend/docker-compose.yaml
Line: 25

I also don't understand that he does not alarm on FLYWAY_USER and FLYWAY_PASSWORD.

Steps to Reproduce

Take teh snippet above and save it into a file.
Run trufflehog

Environment

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional Context

I know i can either exclude the detector or the file but this is not a nice solution.

References

  • #0000
@david-gang david-gang added the bug label Jan 28, 2025
@david-gang
Copy link
Author

david-gang commented Jan 28, 2025

Additionally even if i add

--results=verified,unknown

I am still getting the unverified result. i don't understand why

after going through the code i understand that if we have an unverified result with verification error it is called unknown. the wording

Found unverified result 🐷🔑❓

is confusing. maybe this can be changed.

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

No branches or pull requests

1 participant