Properties Smtp Port 25 Unencrypted
Description
Identifies insecure SMTP server configurations in Java properties files that use unencrypted port 25 without STARTTLS protection. This creates a risk of email communications being intercepted since messages are transmitted in plaintext without encryption.
Detection Strategy
• Check for any property ending with 'mail.smtp.port' that is set to '25'
• Verify that no property ending with 'mail.smtp.starttls.enable' is set to 'true'
• Report a vulnerability when port 25 is used without STARTTLS encryption enabled
Vulnerable code example
# application.properties
spring.mail.host=smtp.example.com
spring.mail.username=user
spring.mail.password=pass
spring.mail.properties.mail.smtp.port=25 # Vulnerable: Using insecure default SMTP port 25 instead of TLS port
spring.mail.properties.mail.smtp.auth=true✅ Secure code example
# application.properties
spring.mail.host=smtp.example.com
spring.mail.username=user
spring.mail.password=pass
spring.mail.properties.mail.smtp.port=587 # Using secure TLS port instead of insecure port 25
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true # Enable TLS encryption for secure email transmission
spring.mail.properties.mail.smtp.starttls.required=true # Require TLS to prevent fallback to insecure connectionSearch 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.