Cleartext Transmission

Cleartext transmission in C#

Description

Requests and responses sent to an http:// URL travel in cleartext.

Potential impact

Someone on the network path can read or alter tokens, session identifiers, personal information or business data.

Remediation

Use HTTPS with certificate validation for external production services and APIs. Limit cleartext HTTP to explicitly designated loopback endpoints such as localhost in development.

Examples

Before

csharp
await httpClient.GetAsync("http://api.example.com/status");

After

csharp
await httpClient.GetAsync("https://api.example.com/status");

GetAsync requests the same status endpoint over https://.

References