Rust Actix Insecure Http Bind
Description
This vulnerability detector identifies insecure HTTP server bindings in Rust applications using the Actix Web framework. When HTTP servers are configured to bind using cleartext protocols instead of HTTPS, all communication between clients and the server is transmitted unencrypted, exposing sensitive data to potential interception and manipulation by attackers.
Detection Strategy
• Scans Rust source code files that import the 'actix_web' library
• Identifies method calls with names that indicate cleartext HTTP binding operations
• Verifies that the method call is being made on an HTTP server object or instance
• Excludes test files from analysis to avoid false positives on development/testing code
• Reports vulnerabilities when cleartext binding methods are found on HTTP server instances in production code
Vulnerable code example
use actix_web::{web, App, HttpServer};
#[actix_web::main]
async fn main() -> std::io::Result<()> {
// VULNERABLE: HttpServer bound without TLS encryption
HttpServer::new(|| App::new())
.bind(("127.0.0.1", 8080))?
.run()...✅ Secure code example
use actix_web::{web, App, HttpServer};
use rustls::ServerConfig;
fn rustls_config() -> ServerConfig {
unimplemented!()
}
#[actix_web::main]...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.