Executable Files Insecure Certificate Validation
Description
Detects use of curl commands that disable SSL certificate validation using -k or --insecure flags. This is dangerous because it bypasses certificate verification, exposing connections to potential man-in-the-middle attacks and making it impossible to verify the identity of remote servers.
Detection Strategy
• Search for curl commands in source files and scripts
• Look for the -k or --insecure flags being used with curl commands
• Report a security issue when curl commands are found that explicitly disable certificate verification
Vulnerable code example
# Dockerfile with insecure TLS practices
FROM ubuntu:latest
# Insecure: Downloads without certificate validation (-k flag)
RUN curl -k https://example.com/package.tar.gz
# Insecure: Multiple commands with --insecure flag bypass cert checks
CMD ["sh", "-c", "curl -v --insecure https://example.com/config && ./start.sh"]✅ Secure code example
# Dockerfile with secure TLS practices
FROM ubuntu:latest
# Secure: Proper certificate validation for downloads
RUN curl https://example.com/package.tar.gz
# Secure: Single command with proper cert validation
CMD ["sh", "-c", "curl -v https://example.com/config && ./start.sh"]Search for vulnerabilities in your apps for free with Fluid Attacks' automated security testing! Start your 21-day free trial and discover the benefits of the Continuous Hacking Essential plan. If you prefer the Advanced plan, which includes the expertise of Fluid Attacks' hacking team, fill out this contact form.