Skip to content

Disabling SSL/TLS Verification in RestClient

Description

The RestClient is configured to disable SSL/TLS verification, which can make the application vulnerable to man-in-the-middle attacks. This is a security risk because it allows an attacker to intercept and modify the communication between the client and the server.

Examples

Insecure Code

ruby
RestClient::Resource.new('https://example.com', :verify_ssl => false).get

Secure Code

ruby
RestClient::Resource.new('https://example.com', :verify_ssl => true).get

Remediation

Enable SSL/TLS verification by setting :verify_ssl to true or a valid OpenSSL::SSL::VERIFY constant.

Rule Details

FieldValue
IDCODE-0807
CategoryInsecureConfig
SeverityCRITICAL
CWECWE-295
ConfidenceHIGH
ImpactHIGH
LikelihoodHIGH
ExploitabilityEASY
Tagsssl, tls, verification
OWASPN/A

References