You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JSON Schema 2020-12 (used in OAS 3.1) defines a new keyword, unevaluatedProperties which is like additionalProperties but works better when using JSON Schema composition with allOf.
For this feature, extend the OWASP ruleset to check if unevaluatedProperties is used and enforce the value false for it.
and also the rule that allows a non-false value for unevaluatedProperties only if maxProperties is also set.
Context
Avoid a false negative when a schema uses unevaluatedProperties: true
Current Behavior
Unlike additionalProperties: true or additionalProperties: { .... },
any use of unevaluatedProperties: true or unevaluatedProperties: { ... } in a schema is not flagged.
Expected Behavior
issue a warning when unevaluatedProperties: true or unevaluatedProperties: { ... } is used in a schema
Possible Solution(s)
Clone the owasp:api6:2019-no-additionalProperties and owasp:api6:2019-constrained-additionalProperties in ruleset.ts and modify to address unevaluatedProperties instead. New rules: owasp:api6:2019-no-unevaluatedPropertiesowasp:api6:2019-constrained-unevaluatedProperties
The text was updated successfully, but these errors were encountered:
DavidBiesack
added a commit
to DavidBiesack/spectral-owasp-ruleset
that referenced
this issue
Aug 17, 2023
JSON Schema 2020-12 (used in OAS 3.1) defines a new keyword,
unevaluatedProperties
which is likeadditionalProperties
but works better when using JSON Schema composition withallOf
.For this feature, extend the OWASP ruleset to check if
unevaluatedProperties
is used and enforce the valuefalse
for it.and also the rule that allows a non-
false
value forunevaluatedProperties
only ifmaxProperties
is also set.Context
Avoid a false negative when a schema uses
unevaluatedProperties: true
Current Behavior
Unlike
additionalProperties: true
oradditionalProperties: { .... }
,any use of
unevaluatedProperties: true
orunevaluatedProperties: { ... }
in a schema is not flagged.Expected Behavior
issue a warning when
unevaluatedProperties: true
orunevaluatedProperties: { ... }
is used in a schemaPossible Solution(s)
Clone the
owasp:api6:2019-no-additionalProperties
andowasp:api6:2019-constrained-additionalProperties
inruleset.ts
and modify to addressunevaluatedProperties
instead. New rules:owasp:api6:2019-no-unevaluatedProperties
owasp:api6:2019-constrained-unevaluatedProperties
The text was updated successfully, but these errors were encountered: