Global OpenAPI schemes include HTTP

HTTP in global schemes advertises unencrypted API communication.

Description

Listing http in top-level schemes lets OpenAPI 2.0 clients choose plaintext HTTP for API calls.

Potential impact

Requests and responses sent over HTTP can be read or changed in transit.

Remediation

Remove http from global schemes and specify https. Check operation-level overrides and require HTTPS on the server and gateway.

Examples

Before

json
{
  "swagger": "2.0",
  "schemes": ["http"]
}

After

json
{
  "swagger": "2.0",
  "schemes": ["https"]
}

References