CWE-319 Base Rascunho High likelihood

Cleartext Transmission of Sensitive Information

This vulnerability occurs when an application sends sensitive data, such as passwords or personal information, over a network connection without using encryption. Attackers can easily intercept and…

Definição

What is CWE-319?

This vulnerability occurs when an application sends sensitive data, such as passwords or personal information, over a network connection without using encryption. Attackers can easily intercept and read this unprotected data as it travels.
When data is transmitted in cleartext, it's like sending a postcard instead of a sealed letter—anyone handling it can read the contents. This is a fundamental security failure because modern networks, especially public Wi-Fi, are shared environments where attackers use simple 'sniffing' tools to capture traffic. Sensitive information like login credentials, session tokens, financial details, or personal data should never be exposed this way. The solution is to always use strong encryption for all communication channels. This means enforcing HTTPS (TLS/SSL) for web traffic and encrypted protocols like SSH or VPNs for other connections. Developers should implement encryption by default, avoid mixed content (HTTP within HTTPS pages), and use security headers like HTTP Strict Transport Security (HSTS) to prevent accidental cleartext transmission.
Vulnerability Diagram CWE-319
Cleartext Transmission Client http://… (no TLS) Public Wi-Fi / ISP POST /login user=alice&pw=hunter2 Cookie: session=abc Server sniffer Anyone on the path reads or rewrites credentials and tokens.
Impacto no mundo real

Real-world CVEs caused by CWE-319

  • Programmable Logic Controller (PLC) sends sensitive information in plaintext, including passwords and session tokens.

  • Building Controller uses a protocol that transmits authentication credentials in plaintext.

  • Programmable Logic Controller (PLC) sends password in plaintext.

  • Passwords transmitted in cleartext.

  • Chain: Use of HTTPS cookie without "secure" flag causes it to be transmitted across unencrypted HTTP.

  • Product sends password hash in cleartext in violation of intended policy.

  • Remote management feature sends sensitive information including passwords in cleartext.

  • Backup routine sends password in cleartext in email.

Como os atacantes a exploram

Trajeto do atacante passo a passo

  1. 1

    The following code attempts to establish a connection to a site to communicate sensitive information.

  2. 2

    Though a connection is successfully made, the connection is unencrypted and it is possible that all sensitive data sent to or received from the server will be read by unintended actors.

  3. 3

    In 2022, the OT:ICEFALL study examined products by 10 different Operational Technology (OT) vendors. The researchers reported 56 vulnerabilities and said that the products were "insecure by design" [REF-1283]. If exploited, these vulnerabilities often allowed adversaries to change how the products operated, ranging from denial of service to changing the code that the products executed. Since these products were often used in industries such as power, electrical, water, and others, there could even be safety implications.

  4. 4

    Multiple vendors used cleartext transmission of sensitive information in their OT products.

  5. 5

    A TAP accessible register is read/written by a JTAG based tool, for internal use by authorized users. However, an adversary can connect a probing device and collect the values from the unencrypted channel connecting the JTAG interface to the authorized user, if no additional protections are employed.

Exemplo de código vulnerável

Vulnerable Java

The following code attempts to establish a connection to a site to communicate sensitive information.

Vulnerável Java
try {
  	URL u = new URL("http://www.secret.example.org/");
  	HttpURLConnection hu = (HttpURLConnection) u.openConnection();
  	hu.setRequestMethod("PUT");
  	hu.connect();
  	OutputStream os = hu.getOutputStream();
  	hu.disconnect();
  }
  catch (IOException e) {
```
//...* 
  	}
Exemplo de código seguro

Secure Shell

Azure's storage accounts can be configured to only accept requests from secure connections made over HTTPS. The secure transfer setting can be enabled using Azure's Portal (GUI) or programmatically by setting the enableHttpsTrafficOnly property to True on the storage account, such as:

Seguro Shell
az storage account update -g {ResourceGroupName} -n {StorageAccountName} --https-only true
What changed: the unsafe sink is replaced (or the input is validated/escaped) so the same payload no longer triggers the weakness.
Lista de verificação de prevenção

How to prevent CWE-319

  • Architecture and Design Before transmitting, encrypt the data using reliable, confidentiality-protecting cryptographic protocols.
  • Implementation When using web applications with SSL, use SSL for the entire session from login to logout, not just for the initial login page.
  • Implementation When designing hardware platforms, ensure that approved encryption algorithms (such as those recommended by NIST) protect paths from security critical data to trusted user applications.
  • Testing Use tools and techniques that require manual (human) analysis, such as penetration testing, threat modeling, and interactive tools that allow the tester to record and modify an active session. These may be more effective than strictly automated techniques. This is especially the case with weaknesses that are related to design and business rules.
  • Operation Configure servers to use encrypted channels for communication, which may include SSL or other secure protocols.
Sinais de deteção

How to detect CWE-319

Black Box

Use monitoring tools that examine the software's process as it interacts with the operating system and the network. This technique is useful in cases when source code is unavailable, if the software was not developed by you, or if you want to verify that the build phase did not introduce any new weaknesses. Examples include debuggers that directly attach to the running process; system-call tracing utilities such as truss (Solaris) and strace (Linux); system activity monitors such as FileMon, RegMon, Process Monitor, and other Sysinternals utilities (Windows); and sniffers and protocol analyzers that monitor network traffic. Attach the monitor to the process, trigger the feature that sends the data, and look for the presence or absence of common cryptographic functions in the call tree. Monitor the network and determine if the data packets contain readable commands. Tools exist for detecting if certain encodings are in use. If the traffic contains high entropy, this might indicate the usage of encryption.

Automated Static Analysis High

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Correção automática do Plexicus

O Plexicus deteta automaticamente o CWE-319 e abre um PR de correção em menos de 60 segundos.

O Codex Remedium analisa cada commit, identifica esta fraqueza exata e entrega um pull request pronto para revisão com o patch. Sem tickets. Sem transferências.

Perguntas frequentes

Frequently asked questions

O que é o CWE-319?

This vulnerability occurs when an application sends sensitive data, such as passwords or personal information, over a network connection without using encryption. Attackers can easily intercept and read this unprotected data as it travels.

Qual a gravidade do CWE-319?

A MITRE classifica a probabilidade de exploração como Alta — esta fraqueza é ativamente explorada em campo e deve ser priorizada para remediação.

Que linguagens ou plataformas são afetadas pelo CWE-319?

MITRE lists the following affected platforms: Cloud Computing, Mobile, ICS/OT, System on Chip, Test/Debug Hardware.

Como posso prevenir o CWE-319?

Before transmitting, encrypt the data using reliable, confidentiality-protecting cryptographic protocols. When using web applications with SSL, use SSL for the entire session from login to logout, not just for the initial login page.

Como é que o Plexicus deteta e corrige o CWE-319?

O motor SAST do Plexicus correlaciona a assinatura de fluxo de dados do CWE-319 em cada commit. Quando é encontrada uma correspondência, o nosso agente Codex Remedium abre um PR de correção com o código corrigido, testes e um resumo de uma linha para o revisor.

Onde posso saber mais sobre o CWE-319?

A MITRE publica a definição canónica em https://cwe.mitre.org/data/definitions/319.html. Pode também consultar a documentação da OWASP e do NIST para orientações adjacentes.

Pronto quando você estiver

Pare de pagar por desenvolvedor.
Comece a fechar o ciclo.

O Plexicus é o ASPM nativo de IA que verifica, filtra, corrige, pentesta e explica — de forma autónoma. Programadores ilimitados, repos ilimitados, ações de IA de utilização justa. Nível gratuito real, €269/mo anual quando estiver pronto.