-
Notifications
You must be signed in to change notification settings - Fork 349
Closed
Labels
bugSomething isn't workingSomething isn't workingcommunityCommunity contributionCommunity contributiondockerDocker queryDocker queryopenapiOpenAPI queryOpenAPI queryqueryNew query featureNew query feature
Description
Expected Behavior
The "Header Object Without Schema" query should not generate a vulnerability if the header object has a schema and is referenced.
Actual Behavior
The "Header Object Without Schema" (50de3b5b-6465-4e06-a9b0-b4c2ba34326b) query generates a medium-level vulnerability.
Steps to Reproduce the Problem
Following openapi.yaml makes KICS find a "Header Object Without Schema" (50de3b5b-6465-4e06-a9b0-b4c2ba34326b) vulnerability:
openapi: "3.0.3"
info:
title: Reproduce "Header Object Without Schema"
version: 1.0.0
servers:
- url: https://example.com/
security:
- bearerAuth: []
paths:
/test:
get:
responses:
'200':
description: Test
headers:
X-Test: { $ref: "#/components/headers/X-Test" }
content:
application/json:
schema:
type: string
pattern: '^test$'
components:
headers:
X-Test:
schema:
type: string
pattern: '^test$'
securitySchemes:
bearerAuth:
type: http
scheme: bearerFollowing openapi.yaml makes KICS not find a "Header Object Without Schema" (50de3b5b-6465-4e06-a9b0-b4c2ba34326b) vulnerability:
openapi: "3.0.3"
info:
title: Reproduce "Header Object Without Schema"
version: 1.0.0
servers:
- url: https://example.com/
security:
- bearerAuth: []
paths:
/test:
get:
responses:
'200':
description: Test
headers:
X-Test:
schema:
type: string
pattern: '^test$'
content:
application/json:
schema:
type: string
pattern: '^test$'
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearerSpecifications
- Version: checkmarx/kics:v2.1.3@sha256:8b191adbd156038cfbc163fd1ab1b210c839bd9e065777287eadc8d267a60b9d
- Platform: Docker
- Subsystem: openapi
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcommunityCommunity contributionCommunity contributiondockerDocker queryDocker queryopenapiOpenAPI queryOpenAPI queryqueryNew query featureNew query feature