logo

Database

C Sharp Oauth Allow Insecure Http True

Description

Detects when OAuth authorization server options in ASP.NET applications are configured to allow insecure HTTP communication. This creates a significant security risk as authentication tokens and credentials could be intercepted if transmitted over unencrypted connections.

Weakness:

332 - Use of insecure channel - Source code

Category: Information Collection

Detection Strategy

    Checks if Microsoft.Owin.Security.OAuth or related packages are imported in the code

    Identifies instances where OAuthAuthorizationServerOptions is being configured

    Examines the configuration to detect if insecure HTTP communication is explicitly allowed

    Reports a vulnerability when OAuth settings are found that permit non-HTTPS connections

Vulnerable code example

using Microsoft.Owin.Security.OAuth;
using Microsoft.Owin;

public class OAuthConfig 
{
    public void ConfigureOAuth(IAppBuilder app)
    {
        var options = new OAuthAuthorizationServerOptions...

✅ Secure code example

using Microsoft.Owin.Security.OAuth;
using Microsoft.Owin;

public class OAuthConfig 
{
    public void ConfigureOAuth(IAppBuilder app)
    {
        var options = new OAuthAuthorizationServerOptions...