Aller au contenu

Cleartext HTTP (ARCH6118)

Ce contenu n’est pas encore disponible dans votre langue.

Key ruby.security.cleartext-http · Severity warning · Category security · CWE CWE-319

Sending sensitive data over http:// leaves traffic unencrypted and exposed to man-in-the-middle attacks. Use TLS (https://) for all endpoints.

require "net/http"
uri = URI("http://api.example.com/login")
res = Net::HTTP.post_form(uri, email: email, password: password)
require "net/http"
uri = URI("https://api.example.com/login")
res = Net::HTTP.post_form(uri, email: email, password: password)

Switch all remote endpoints to https:// and keep TLS validation enabled.