slop/insecure-patterns
No disabled TLS verification or similar shortcuts
| Severity | warning |
| Tiers | all |
| Stacks | any |
| Scope | root |
| Kind | expr |
| Source | library v0.7.0 |
| Selected by | fleetlint-slop@v0.7.0 |
Requirement
No globally disabled certificate verification (a callback that accepts every certificate, InsecureSkipVerify, verify=False, rejectUnauthorized: false, VERIFY_NONE), bare eval(, chmod 777 or wildcard CORS origin in non-test code. Method calls named eval (model.eval(), redis.eval() and certificate callbacks that check the certificate are not findings.
Why
Each one was added to make something work once and removes a protection for every user afterwards.
Check
For each item in:
codegrep("nontest", r'badCertificateCallback\s*=\s*\([^)]*\)\s*=>\s*true|ServerCertificateCustomValidationCallback\s*=.*=>\s*true|InsecureSkipVerify:\s*true|verify\s*=\s*False|rejectUnauthorized:\s*false|NODE_TLS_REJECT_UNAUTHORIZED|danger_accept_invalid_certs|CURLOPT_SSL_VERIFYPEER,\s*(false|0)\b|VERIFY_NONE\b|(^|[^.\w$])eval\(|chmod\s+(-R\s+)?777|Allow-Origin[\x22\x27]?\s*[:,]\s*[\x22\x27]\*')falseFix
Scope the exception to one host or one path with explicit opt-in, or remove it.
Agent instruction: Report each occurrence with what it disables; replace only when the secure equivalent is evident.
Sources
- https://cwe.mitre.org/data/definitions/295.html (standard, CWE-295: Improper Certificate Validation)
- https://github.com/securego/gosec (check, G402)
- https://bandit.readthedocs.io/en/latest/plugins/b501_request_with_no_cert_validation.html (check, B501)
- https://docs.astral.sh/ruff/rules/suspicious-eval-usage/ (check, S307)
- https://docs.astral.sh/ruff/rules/bad-file-permissions/ (check, S103)
- https://fleetlint.org/baseline/#slop
- https://fleetlint.org/slop/#errors-types-and-robustness
Generated by fleetlint docs from catalog v0.7.0.