Rule Definition
Service providers using Username Token may accept passwords sent in clear text. If the plaintext password is sent through an unencrypted channel, an attacker who can intercept the SOAP message will take the opportunity to obtain credentials.
Remediation
Always use Windows or Certificate as client credential type
Violation Code Sample
XML Config:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="SecureBinding">
<security mode="Message">
<message clientCredentialType="UserName" /> //Violation - Client Credential type
//None/UserName/IssuedToken are not preferred
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
______________________________________________________________________
C#:
ServiceHost myServiceHost = new ServiceHost(typeof(CalculatorService));
// Create a binding to use.
WSHttpBinding binding = new WSHttpBinding();
binding.Security.Mode = SecurityMode.Message;
binding.Security.Message.ClientCredentialType =
MessageCredentialType.None; //Violation: Client Credential type Issued Token/None/UserName are not preferred
Fixed Code Sample
XML Config:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="SecureBinding">
<security mode="Message">
<message clientCredentialType="Windows" /> //Violation Fixed
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
_______________________________________________________________
C#:
ServiceHost myServiceHost = new ServiceHost(typeof(CalculatorService));
// Create a binding to use.
WSHttpBinding binding = new WSHttpBinding();
binding.Security.Mode = SecurityMode.Message;
binding.Security.Message.ClientCredentialType =
MessageCredentialType.Certificate; //Fixed-Credential type certificate is used
Reference
https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/wcf/clientcredentials
OWASP Top 10 2017 A6 Security Misconfiguration
Related Technologies
Technical Criterion
PCI-DSS4-Requirement-2.2.6 - System security parameters are configured to prevent misuse
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.