Security Bug: Health Endpoint Discloses Actix Web and Rust Version Information
Description
The /api/hello health check endpoint is accessible without authentication and
returns response headers including Server: actix-web/X.Y.Z. This discloses
the exact web framework version to any caller. An attacker scanning for
vulnerable Actix Web versions can quickly identify whether this deployment is
running a version with known CVEs without any privileged access.
Steps to Reproduce
- Send a request to the health endpoint:
curl -I http://localhost:8000/api/hello
- Observe the response headers:
- Cross-reference the version against the Actix Web CVE database.
Root Cause
Actix Web includes a Server header with the framework name and version by
default. No middleware removes or replaces this header.
Impact
Version disclosure enables targeted exploitation of known framework
vulnerabilities without any brute-force or active probing.
Proposed Fix
Disable or replace the default Server header:
use actix_web::{middleware, App, HttpServer};
HttpServer::new(|| {
App::new()
.wrap(middleware::DefaultHeaders::new()
.add(("Server", "rust-tune")) // Generic name, no version
)
.service(hello)
})
.disable_signals()
.bind("0.0.0.0:8000")?
.run()
.await
Security Bug: Health Endpoint Discloses Actix Web and Rust Version Information
Description
The
/api/hellohealth check endpoint is accessible without authentication andreturns response headers including
Server: actix-web/X.Y.Z. This disclosesthe exact web framework version to any caller. An attacker scanning for
vulnerable Actix Web versions can quickly identify whether this deployment is
running a version with known CVEs without any privileged access.
Steps to Reproduce
Root Cause
Actix Web includes a
Serverheader with the framework name and version bydefault. No middleware removes or replaces this header.
Impact
Version disclosure enables targeted exploitation of known framework
vulnerabilities without any brute-force or active probing.
Proposed Fix
Disable or replace the default
Serverheader: