Operation accepts HTTP requests in the clear

Description

The API operation accepts HTTP communications in the clear. HTTP traffic is not encrypted and can thus be easily intercepted.

For more details, see the OpenAPI Specification.

Example

The following is an example of how this type of risk could look in your API definition. The alternative server defined for the operation accepts unencrypted connections:

1get:
2  description: Returns pets based on ID
3  summary: Find pets by ID
4  operationId: getPetsById
5  servers:
6    - url: http://my.api.com
7      description: Development server
8  # ...
9

Possible exploit scenario

If your API supports unencrypted HTTP connections, all requests and responses are transmitted in the open. Anyone listening to the network traffic while the calls are being made may intercept them.

Remediation

Use only secure connections for the servers:

1get:
2  description: Returns pets based on ID
3  summary: Find pets by ID
4  operationId: getPetsById
5  servers:
6    - url: https://my.api.com
7      description: Development server
8  # ...
9

Copyright 42Crunch 2021