logo

Database

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.

Weakness:

313 - Insecure service configuration - Certificates

Category: Functionality Abuse

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"]