Project: KICS (Provisioning / Security & Compliance)
File: 77276d82-4f45-4cf1-8e2b-4d345b936228.md

title: Global Security Scheme Using Basic Authentication hide: toc: true navigation: true <style> .highlight .hll { background-color: #ff171742; } .md-content { max-width: 1100px; margin: 0 auto; } </style> Query id: 77276d82-4f45-4cf1-8e2b-4d345b936228 Query name: Global Security Scheme Using Basic Authentication Platform: OpenAPI Severity: <span style="color:#ff7213">Medium</span> Category: Access Control URL: A security scheme is allowing basic authentication credentials to be transported over network<br> ```json title="Positive test num. 1 - json file" hl_lines="51" { "openapi": "3.0.0", "info": { "title": "Simple KICS API", "version": "1.0.0" }, "paths": { "/": { "get": { "operationId": "listVersions", "summary": "List versions", "responses": { "200": { "description": "200 response", "content": { "application/json": { "examples": { "foo": { "value": { "versions": [ { "status": "CURRENT", "updated": "2011-01-21T11:33:21Z", "id": "v2.0", "links": [ { "href": "http://127.0.0.1:8774/v2/", "rel": "self" } ] } ] } } } } } } } } } }, "servers": [ { "url": "http://kicsapi.server.com/", "description": "API server" } ], "components": { "securitySchemes": { "regularSecurity": { "type": "http", "scheme": "basic" } } } } ``` ```yaml title="Positive test num. 2 - yaml file" hl_lines="30" openapi: 3.0.0 info: title: Simple API overview version: 1.0.0 paths: "/": get: operationId: listVersions summary: List versions responses: "200": description: 200 response content: application/json: examples: foo: value: versions: status: CURRENT updated: "2011-01-21T11:33:21Z" id: v2.0 links: href: http://127.0.0.1:8774/v2/ rel: self servers: url: http://kicsapi.server.com/ description: API server components: securitySchemes: regularSecurity: type: http scheme: basic ``` ```json title="Negative test num. 1 - json file" { "openapi": "3.0.0", "info": { "title": "Simple KICS API", "version": "1.0.0" }, "paths": { "/": { "get": { "operationId": "listVersions", "summary": "List versions", "responses": { "200": { "description": "200 response", "content": { "application/json": { "examples": { "foo": { "value": { "versions": [ { "status": "CURRENT", "updated": "2011-01-21T11:33:21Z", "id": "v2.0", "links": [ { "href": "http://127.0.0.1:8774/v2/", "rel": "self" } ] } ] } } } } } } } } } }, "servers": [ { "url": "https://kicsapi.server.com/", "description": "API server" } ], "components": { "securitySchemes": { "OAuth2": { "type": "oauth2", "flows": { "authorizationCode": { "scopes": { "write": "modify objects", "read": "read objects" }, "authorizationUrl": "https://kicsapi.com/oauth/authorize", "tokenUrl": "https://kicsapi.com/oauth/token" } } } } }, "security": [ { "OAuth2": [ "write", "read" ] } ] } ``` ```yaml title="Negative test num. 2 - yaml file" openapi: 3.0.0 info: title: Simple KICS API version: 1.0.0 paths: "/": get: operationId: listVersions summary: List versions responses: "200": description: 200 response content: application/json: examples: foo: value: versions: status: CURRENT updated: "2011-01-21T11:33:21Z" id: v2.0 links: href: http://127.0.0.1:8774/v2/ rel: self servers: url: https://kicsapi.server.com/ description: API server components: securitySchemes: OAuth2: type: oauth2 flows: authorizationCode: scopes: write: modify objects in your account read: read objects in your account authorizationUrl: https://kicsauthenticator.com/oauth/authorize tokenUrl: https://kicsauthenticator.com/oauth/token security: OAuth2: write read ```