security icon indicating copy to clipboard operation
security copied to clipboard

API Security Analyzer for OpenAPI/Swagger Specs

Open heltonduarte opened this issue 1 year ago • 0 comments

This feature would introduce a specialized vulnerability type in our security taxonomy to analyze API definition files like openapi.yaml or swagger.json for security best-practice violations.

The scanner would check for common issues such as:

  • Endpoints missing security scheme definitions (e.g., no authentication).
  • Use of insecure protocols (http instead of https).
  • Lack of defined rate-limiting properties.
  • Sensitive data being passed in query parameters instead of the request body.
  • Vague or overly permissive data type definitions (e.g., type: object without defined properties).

Open question: is there an open source tool we could use to help Gemini on the analysis?

Example 1:

{
  "swagger": "2.0",
  "info": {
    "title": "Bad Swagger API",
    "version": "1.0.0"
  },
  "paths": {
    "/reports/confidential": {
      "get": {
        "summary": "Get confidential report",
        "parameters": [
          {
            "name": "apiKey",
            "in": "query",
            "description": "API Key passed in URL (insecure!)",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Report data"
          }
        }
      }
    }
  }
}

Example 2:

openapi: 3.0.0
info:
  title: Insecure Transport API
  version: 1.0.0
servers:
  - url: http://api.example.com/v1 # <-- Insecure HTTP
paths:
  /data:
    get:
      summary: Get some data
      responses:
        '200':
          description: OK

heltonduarte avatar Oct 08 '25 00:10 heltonduarte