HIGH missing tlsactixdynamodb

Missing Tls in Actix with Dynamodb

Missing Tls in Actix with Dynamodb — how this specific combination creates or exposes the vulnerability

When an Actix-web service communicates with Amazon DynamoDB without Transport Layer Security (TLS), credentials, tokens, and potentially sensitive payload data traverse the network in cleartext. This specific combination exposes risks because DynamoDB endpoints that do not enforce HTTPS allow interception on-path, and misconfigured Actix clients may inadvertently send requests over plain HTTP. An attacker who can observe or inject traffic on the network path can capture AWS signature–based authentication material and reuse it to make unauthorized DynamoDB operations. In secure designs, TLS is mandatory for all DynamoDB endpoints, and Actix clients must be configured to reject non-TLS responses. middleBrick detects this condition during black-box scanning by observing whether the API endpoint under test requires HTTPS for interactions that involve sensitive data or credentials, and by checking whether the service’s publicly documented integration points encourage or require TLS when accessing DynamoDB resources.

Using OpenAPI/Swagger spec analysis, middleBrick cross-references the declared DynamoDB host and protocol with runtime behavior. If the spec specifies http:// for DynamoDB or omits protocol guidance while runtime calls succeed over HTTP, a Missing Tls finding is raised. This finding maps to OWASP API Top 10 A05:2023 (Security Misconfiguration) and can intersect with data exposure risks when tokens or PII are handled by the Actix service. Because middleBrick tests unauthenticated attack surfaces, it can surface missing TLS enforcement even when no credentials are supplied, highlighting that the API surface does not mandate encrypted transport for DynamoDB-bound requests.

Dynamodb-Specific Remediation in Actix — concrete code fixes

To remediate Missing Tls when integrating Actix with DynamoDB, enforce HTTPS for all DynamoDB client endpoints and validate server certificates. Update the AWS SDK client configuration to use https and ensure the region endpoint explicitly references the secure protocol. Below are concrete, working examples in Rust using the official AWS SDK for Rust with Actix.

use aws_config::meta::region::RegionProviderChain;
use aws_sdk_dynamodb::Client;
use actix_web::{web, App, HttpResponse, HttpServer, Responder};

async fn get_item_handler() -> impl Responder {
    let region_provider = RegionProviderChain::default_provider().or_else("us-east-1");
    let config = aws_config::from_env().region(region_provider).load().await;
    let client = Client::new(&config);

    let request = client.get_item()
        .table_name("users")
        .key("user_id", aws_sdk_dynamodb::types::AttributeValue::S("12345".to_string()))
        .send()
        .await;

    match request.await {
        Ok(output) => HttpResponse::Ok().json(output),
        Err(err) => HttpResponse::InternalServerError().body(err.to_string()),
    }
}

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| {
        App::new()
            .route("/user", web::get().to(get_item_handler))
    })
    .bind("0.0.0.0:8080")?
    .run()
    .await
}

Ensure that the AWS SDK is not overridden with a custom HTTP connector that disables TLS verification. If you use environment variables to control endpoints, avoid setting AWS_ENDPOINT_URL to an http:// value. middleBrick’s CLI can validate your configuration by scanning the API surface; the Pro plan enables continuous monitoring so that future changes to endpoint settings are flagged if they weaken TLS enforcement. For teams using the GitHub Action, you can gate CI/CD pipelines to fail if insecure DynamoDB endpoint references are detected in your build artifacts.

Additionally, prefer SDK defaults that enforce secure transport and rotate credentials regularly. The MCP Server can be used to scan APIs directly from your AI coding assistant while you develop, providing inline feedback that encourages TLS-compliant DynamoDB integration patterns before code is committed.

Related CWEs: encryption

CWE IDNameSeverity
CWE-319Cleartext Transmission of Sensitive Information HIGH
CWE-295Improper Certificate Validation HIGH
CWE-326Inadequate Encryption Strength HIGH
CWE-327Use of a Broken or Risky Cryptographic Algorithm HIGH
CWE-328Use of Weak Hash HIGH
CWE-330Use of Insufficiently Random Values HIGH
CWE-338Use of Cryptographically Weak PRNG MEDIUM
CWE-693Protection Mechanism Failure MEDIUM
CWE-757Selection of Less-Secure Algorithm During Negotiation HIGH
CWE-261Weak Encoding for Password HIGH

Frequently Asked Questions

How does middleBrick detect Missing Tls in an Actix service that uses DynamoDB?
middleBrick observes runtime behavior of the unauthenticated attack surface and cross-references the OpenAPI/Swagger spec for the declared protocol to DynamoDB hosts. If the API allows successful calls over HTTP to DynamoDB or does not enforce HTTPS, a Missing Tls finding is raised.
Can the middleBrick GitHub Action prevent insecure DynamoDB configurations from reaching production?
Yes. By adding the GitHub Action to your CI/CD pipeline and setting a risk threshold, builds can fail automatically when the scan detects Missing Tls or other high-severity findings related to insecure communication with DynamoDB.