Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ There are 4 main contributions in WFC:

1) _WFC Authentication_ (<!--M1-->0.8.0<!--M1-->): a JSON Schema definition to represent authentication information for fuzzers. Currently under [src/main/resources/wfc/schemas/auth.yaml](src/main/resources/wfc/schemas/auth.yaml). Documentation on how to use it [can be found here](./auth.md). Examples of configurations files can be found in the [Web Fuzzing Dataset (WFD) repository](https://github.com/WebFuzzing/Dataset).

2) _WFC Faults_ (<!--M2-->0.10.0<!--M2-->): classification of existing automated oracles proposed in the literature of fuzzing web APIs. Currently under [src/main/resources/wfc/faults/fault_categories.json](src/main/resources/wfc/faults/fault_categories.json).
2) _WFC Faults_ (<!--M2-->0.11.0<!--M2-->): classification of existing automated oracles proposed in the literature of fuzzing web APIs. Currently under [src/main/resources/wfc/faults/fault_categories.json](src/main/resources/wfc/faults/fault_categories.json).
A human-friendly readable version can be found under [faults.md](faults.md).

3) _WFC Report_ (<!--M3-->0.10.0<!--M3-->): a JSON schema definition to represent output information from the fuzzers. Currently under [src/main/resources/wfc/schemas/report.yaml](src/main/resources/wfc/schemas/report.yaml).
3) _WFC Report_ (<!--M3-->0.11.0<!--M3-->): a JSON schema definition to represent output information from the fuzzers. Currently under [src/main/resources/wfc/schemas/report.yaml](src/main/resources/wfc/schemas/report.yaml).

4) _WFC Web Report_ (<!--M4-->0.9.0<!--M4-->): a web application that is able to visualize and interact with fuzzer reports in WFC format. Currently under [web-report](web-report).
The build also produces `wfc-summary.cjs`, a Node script that renders a report as Markdown for CI systems (e.g., GitHub Actions job summaries and PR comments), see [web-report/README.md](web-report/README.md#ci-summary-cli).
Expand Down
12 changes: 7 additions & 5 deletions faults.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Fault Category Descriptions

## Summary
Total: 52
Total: 54

_HTTP Faults_ (1xx): 26

_Schema Faults_ (2xx): 8
_Schema Faults_ (2xx): 10

_Security Faults_ (3xx): 18

Expand Down Expand Up @@ -39,14 +39,16 @@ _Security Faults_ (3xx): 18
|123|HTTP Violation: Read Operation Broken After Fuzzing|If a GET operation on an endpoint succeeded before fuzzing, repeating the same valid GET request after fuzzing write operations (e.g., POST, PUT and PATCH) on that path should not fail with a 5xx server error. A server error at this point suggests that a fuzzed write operation stored corrupted data that now breaks subsequent reads.|
|124|HTTP Violation: Updated Resource State Not Reflected On Subsequent Read|If a resource is successfully updated (e.g., with a PUT or PATCH returning a 2xx status code), reading the resource back with a GET right after should reflect the updated writable fields. If the comparable fields still have their old values or differ from what was sent in the update, the update was silently ignored or not persisted properly.|
|125|HTTP Violation: Update With Stale ETag Precondition Accepted|Optimistic concurrency control in HTTP uses ETags and the If-Match header to prevent lost updates. If a resource is modified so that its ETag changes, a subsequent write request (e.g., PUT or PATCH) carrying the old, stale If-Match ETag should be rejected (typically with 412 Precondition Failed), rather than succeeding and overwriting the newer state.|
|200|Schema Violation: Received A Response From API With A Structure/Data That Is Not Matching Its Schema|A schema, like for example OpenAPI for REST, defines the structures not only of the inputs but also the outputs of the API. If what returned by an API is not conforming to its schema, then it is a clear fault. However, whether the fault is in the API (i.e., it does not conform to the schema) or in the schema itself (i.e., it is underspecified, or having mistakes) is something that cannot be known for sure without debugging the issue.|
|200|Received User Error Response When Sending Valid Data|The converse of 'Received Success Response When Sending Wrong Data'. If all input data satisfies the types and constraints defined in the schema, then the API should not mark the request as 'user error' (e.g., with a 400 or 422 in REST). Status codes that do not depend on data validity, like 401, 403, 404, 409 and 429, are not considered here. Either the schema is incorrect (e.g., it is missing some constraints), or the API rejects valid data. As OpenAPI is not able to express all possible types of input constraints (e.g., inter-parameter dependencies), depending on the API this oracle might lead to some false positives.|
|201|Schema Violation: Invalid Allow HTTP Header|A returned Allow header specifies what operations (e.g., GET and PATCH) are available on a resource. For consistency, this needs to match what actually defined in the schema of the API, apart from special cases such as HEAD and OPTIONS.|
|202|Schema Violation: no-401-if-no-auth|Should not return a 401 non-authenticated if there is no authentication in the definition of the API (or conversely, authentication definition is wrongly missing).|
|203|Schema Violation: no-403-if-no-401|Should not return a 403 non-authorized if there is no 401 non-authenticated in the definition of the API (or conversely, such definition is wrongly missing).|
|204|Schema Violation: has-406-if-accept|If a valid payload is sent based on what declared in the schema, it should not happen that the API responds with a 406 non-valid payload type.|
|205|Schema Violation: no-501-if-implemented|If a schema defines an endpoint, then a call on it should not return a 501 Non-Implemented.|
|206|Received Success Response When Sending Wrong Data|API inputs might have constraints (e.g., integers in a specific range, and strings matching a given regular expression). Also, they need be to of specific types (e.g., integers, booleans, strings, dates, arrays and objects). If some input data does not satisfy the type on constraints defined in the schema, then the API should mark the request as 'user error'. However, if for any reason the request is processed successfully, then it is a fault. Either the schema is incorrect, or the API is not properly discarding invalid data.|
|207|Received User Error Response When Sending Valid Data|The converse of 'Received Success Response When Sending Wrong Data'. If all input data satisfies the types and constraints defined in the schema, then the API should not mark the request as 'user error' (e.g., with a 400 or 422 in REST). Status codes that do not depend on data validity, like 401, 403, 404, 409 and 429, are not considered here. Either the schema is incorrect (e.g., it is missing some constraints), or the API rejects valid data. As OpenAPI is not able to express all possible types of input constraints (e.g., inter-parameter dependencies), depending on the API this oracle might lead to some false positives.|
|206|Schema Violation: Received A Status Code From API That Is Not Matching Its Schema|A schema, like for example OpenAPI for REST, defines which status codes to expect from an endpoint. If what returned by an API is not conforming to what declared in the schema, then it is a clear fault. But, a schema might still define a 'catch-all' definition for errors, like 'default' for codes in OpenAPI. In those cases, it would not be a fault. At any rate, whether a detected fault is in the API (i.e., it does not conform to the schema) or in the schema itself (i.e., it is underspecified, or having mistakes) is something that cannot be known for sure without debugging the issue.|
|207|Schema Violation: Received A Body Response From API With A Structure/Data That Is Not Matching Its Schema|A schema, like for example OpenAPI for REST, defines the structures not only of the inputs but also the outputs of the API. If what returned by an API is not conforming to its schema, then it is a clear fault. However, whether the fault is in the API (i.e., it does not conform to the schema) or in the schema itself (i.e., it is underspecified, or having mistakes) is something that cannot be known for sure without debugging the issue.|
|208|Schema Violation: Received Meta-Data Headers From API With A Structure/Data That Is Not Matching Its Schema|A schema, like for example OpenAPI for REST, defines the structures not only of the inputs but also the outputs of the API, including possible meta-data like HTTP headers. If what returned by an API is not conforming to its schema, then it is a clear fault. In the case of HTTP headers, though, extra received headers are usually not problematic. What is problematic is a returned header that is specified in the schema, but then the returned value is not compliant with the defined constraints. However, whether the fault is in the API (i.e., it does not conform to the schema) or in the schema itself (i.e., it is underspecified, or having mistakes) is something that cannot be known for sure without debugging the issue.|
|209|Received Success Response When Sending Wrong Data|API inputs might have constraints (e.g., integers in a specific range, and strings matching a given regular expression). Also, they need be to of specific types (e.g., integers, booleans, strings, dates, arrays and objects). If some input data does not satisfy the type on constraints defined in the schema, then the API should mark the request as 'user error'. However, if for any reason the request is processed successfully, then it is a fault. Either the schema is incorrect, or the API is not properly discarding invalid data.|
|300|SQL Injection (SQLi)|Input data was not properly sanitized. Its use in SQL commands led to execute arbitrary commands on the database. See OWASP Top 10 for more information.|
|301|Cross-Site Scripting (XSS)|XSS is an attack in which it is possible to inject malicious scripts into web pages viewed users. This works as well in APIs, if the malicious payload is stored as it is, and then read afterwards by a frontend web application. See OWASP Top 10 for more information.|
|302|Server-Side Request Forgery (SSRF)|Some inputs might be URLs, which are then used by the API to retrieve data from external services. However, if the hostnames of these URLs are not verified, the API could be tricked into making requests towards servers it should not to, like for example the 'localhost'. See OWASP Top 10 for more information.|
Expand Down
44 changes: 30 additions & 14 deletions pypi-distribution/src/webfuzzing_commons/data/fault_categories.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,12 @@
"testCaseLabel" : "staleEtagAccepted"
}, {
"code" : 200,
"descriptiveName" : "Schema Violation: Received A Response From API With A Structure/Data That Is Not Matching Its Schema",
"fullDescription" : "A schema, like for example OpenAPI for REST, defines the structures not only of the inputs but also the outputs of the API. If what returned by an API is not conforming to its schema, then it is a clear fault. However, whether the fault is in the API (i.e., it does not conform to the schema) or in the schema itself (i.e., it is underspecified, or having mistakes) is something that cannot be known for sure without debugging the issue.",
"descriptiveName" : "Received User Error Response When Sending Valid Data",
"fullDescription" : "The converse of 'Received Success Response When Sending Wrong Data'. If all input data satisfies the types and constraints defined in the schema, then the API should not mark the request as 'user error' (e.g., with a 400 or 422 in REST). Status codes that do not depend on data validity, like 401, 403, 404, 409 and 429, are not considered here. Either the schema is incorrect (e.g., it is missing some constraints), or the API rejects valid data. As OpenAPI is not able to express all possible types of input constraints (e.g., inter-parameter dependencies), depending on the API this oracle might lead to some false positives.",
"group" : "G_2XX",
"id" : "SCHEMA_INVALID_RESPONSE",
"label" : "F200:Schema Violation: Received A Response From API With A Structure/Data That Is Not Matching Its Schema",
"testCaseLabel" : "returnsMismatchResponseWithSchema"
"id" : "SCHEMA_VALID_INPUT_REJECTED",
"label" : "F200:Received User Error Response When Sending Valid Data",
"testCaseLabel" : "rejectedValidInputs"
}, {
"code" : 201,
"descriptiveName" : "Schema Violation: Invalid Allow HTTP Header",
Expand Down Expand Up @@ -256,20 +256,36 @@
"testCaseLabel" : "501OnDeclaredEndpoint"
}, {
"code" : 206,
"descriptiveName" : "Schema Violation: Received A Status Code From API That Is Not Matching Its Schema",
"fullDescription" : "A schema, like for example OpenAPI for REST, defines which status codes to expect from an endpoint. If what returned by an API is not conforming to what declared in the schema, then it is a clear fault. But, a schema might still define a 'catch-all' definition for errors, like 'default' for codes in OpenAPI. In those cases, it would not be a fault. At any rate, whether a detected fault is in the API (i.e., it does not conform to the schema) or in the schema itself (i.e., it is underspecified, or having mistakes) is something that cannot be known for sure without debugging the issue.",
"group" : "G_2XX",
"id" : "SCHEMA_INVALID_RESPONSE_STATUS",
"label" : "F206:Schema Violation: Received A Status Code From API That Is Not Matching Its Schema",
"testCaseLabel" : "returnsUnknownStatusCode"
}, {
"code" : 207,
"descriptiveName" : "Schema Violation: Received A Body Response From API With A Structure/Data That Is Not Matching Its Schema",
"fullDescription" : "A schema, like for example OpenAPI for REST, defines the structures not only of the inputs but also the outputs of the API. If what returned by an API is not conforming to its schema, then it is a clear fault. However, whether the fault is in the API (i.e., it does not conform to the schema) or in the schema itself (i.e., it is underspecified, or having mistakes) is something that cannot be known for sure without debugging the issue.",
"group" : "G_2XX",
"id" : "SCHEMA_INVALID_RESPONSE_BODY",
"label" : "F207:Schema Violation: Received A Body Response From API With A Structure/Data That Is Not Matching Its Schema",
"testCaseLabel" : "returnsMismatchResponseWithSchema"
}, {
"code" : 208,
"descriptiveName" : "Schema Violation: Received Meta-Data Headers From API With A Structure/Data That Is Not Matching Its Schema",
"fullDescription" : "A schema, like for example OpenAPI for REST, defines the structures not only of the inputs but also the outputs of the API, including possible meta-data like HTTP headers. If what returned by an API is not conforming to its schema, then it is a clear fault. In the case of HTTP headers, though, extra received headers are usually not problematic. What is problematic is a returned header that is specified in the schema, but then the returned value is not compliant with the defined constraints. However, whether the fault is in the API (i.e., it does not conform to the schema) or in the schema itself (i.e., it is underspecified, or having mistakes) is something that cannot be known for sure without debugging the issue.",
"group" : "G_2XX",
"id" : "SCHEMA_INVALID_RESPONSE_HEADERS",
"label" : "F208:Schema Violation: Received Meta-Data Headers From API With A Structure/Data That Is Not Matching Its Schema",
"testCaseLabel" : "returnsMismatchHeadersWithSchema"
}, {
"code" : 209,
"descriptiveName" : "Received Success Response When Sending Wrong Data",
"fullDescription" : "API inputs might have constraints (e.g., integers in a specific range, and strings matching a given regular expression). Also, they need be to of specific types (e.g., integers, booleans, strings, dates, arrays and objects). If some input data does not satisfy the type on constraints defined in the schema, then the API should mark the request as 'user error'. However, if for any reason the request is processed successfully, then it is a fault. Either the schema is incorrect, or the API is not properly discarding invalid data.",
"group" : "G_2XX",
"id" : "SCHEMA_VALIDATION_BYPASS",
"label" : "F206:Received Success Response When Sending Wrong Data",
"label" : "F209:Received Success Response When Sending Wrong Data",
"testCaseLabel" : "successOnInvalidInputs"
}, {
"code" : 207,
"descriptiveName" : "Received User Error Response When Sending Valid Data",
"fullDescription" : "The converse of 'Received Success Response When Sending Wrong Data'. If all input data satisfies the types and constraints defined in the schema, then the API should not mark the request as 'user error' (e.g., with a 400 or 422 in REST). Status codes that do not depend on data validity, like 401, 403, 404, 409 and 429, are not considered here. Either the schema is incorrect (e.g., it is missing some constraints), or the API rejects valid data. As OpenAPI is not able to express all possible types of input constraints (e.g., inter-parameter dependencies), depending on the API this oracle might lead to some false positives.",
"group" : "G_2XX",
"id" : "SCHEMA_VALID_INPUT_REJECTED",
"label" : "F207:Received User Error Response When Sending Valid Data",
"testCaseLabel" : "rejectedValidInputs"
}, {
"code" : 300,
"descriptiveName" : "SQL Injection (SQLi)",
Expand Down
2 changes: 1 addition & 1 deletion pypi-distribution/src/webfuzzing_commons/data/report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ $defs:
maximum: 125
- type: integer
minimum: 200
maximum: 207
maximum: 209
- type: integer
minimum: 300
maximum: 317
Expand Down
Loading
Loading