Skip to content

Commit c39d543

Browse files
committed
- Schema validate against bad domain characters - Integration test for CVE POC examples - Cypress rewrite of plugins for file upload
1 parent 7c97516 commit c39d543

File tree

19 files changed

+353
-175
lines changed

19 files changed

+353
-175
lines changed

backend/schema/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"uniqueItems": true,
7777
"items": {
7878
"type": "string",
79-
"pattern": "^(?:\\*\\.)?(?:[^.*]+\\.?)+[^.]$"
79+
"pattern": "^[^&| @!#%^();:/\\\\}{=+?<>,~`'\"]+$"
8080
}
8181
},
8282
"enabled": {

backend/schema/components/error.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "object",
3+
"description": "Error",
4+
"properties": {
5+
"error": {
6+
"$ref": "./error-object.json"
7+
}
8+
}
9+
}

backend/schema/paths/nginx/certificates/post.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,26 @@
7272
}
7373
}
7474
}
75+
},
76+
"400": {
77+
"description": "400 response",
78+
"content": {
79+
"application/json": {
80+
"examples": {
81+
"default": {
82+
"value": {
83+
"error": {
84+
"code": 400,
85+
"message": "Domains are invalid"
86+
}
87+
}
88+
}
89+
},
90+
"schema": {
91+
"$ref": "../../../components/error.json"
92+
}
93+
}
94+
}
7595
}
7696
}
7797
}

backend/schema/paths/nginx/certificates/validate/post.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,42 @@
5050
"certificate_key": true
5151
}
5252
}
53+
},
54+
"schema": {
55+
"type": "object",
56+
"additionalProperties": false,
57+
"required": ["certificate", "certificate_key"],
58+
"properties": {
59+
"certificate": {
60+
"type": "object",
61+
"additionalProperties": false,
62+
"required": ["cn", "issuer", "dates"],
63+
"properties": {
64+
"cn": {
65+
"type": "string"
66+
},
67+
"issuer": {
68+
"type": "string"
69+
},
70+
"dates": {
71+
"type": "object",
72+
"additionalProperties": false,
73+
"required": ["from", "to"],
74+
"properties": {
75+
"from": {
76+
"type": "integer"
77+
},
78+
"to": {
79+
"type": "integer"
80+
}
81+
}
82+
}
83+
}
84+
},
85+
"certificate_key": {
86+
"type": "boolean"
87+
}
88+
}
5389
}
5490
}
5591
}
@@ -67,6 +103,9 @@
67103
}
68104
}
69105
}
106+
},
107+
"schema": {
108+
"$ref": "../../../../components/error.json"
70109
}
71110
}
72111
}

backend/schema/paths/nginx/dead-hosts/hostID/disable/post.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151
},
5252
"schema": {
53-
"$ref": "../../../../../components/error-object.json"
53+
"$ref": "../../../../../components/error.json"
5454
}
5555
}
5656
}

backend/schema/paths/nginx/dead-hosts/hostID/enable/post.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151
},
5252
"schema": {
53-
"$ref": "../../../../../components/error-object.json"
53+
"$ref": "../../../../../components/error.json"
5454
}
5555
}
5656
}

backend/schema/paths/nginx/proxy-hosts/hostID/disable/post.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151
},
5252
"schema": {
53-
"$ref": "../../../../../components/error-object.json"
53+
"$ref": "../../../../../components/error.json"
5454
}
5555
}
5656
}

backend/schema/paths/nginx/proxy-hosts/hostID/enable/post.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151
},
5252
"schema": {
53-
"$ref": "../../../../../components/error-object.json"
53+
"$ref": "../../../../../components/error.json"
5454
}
5555
}
5656
}

backend/schema/paths/nginx/redirection-hosts/hostID/disable/post.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151
},
5252
"schema": {
53-
"$ref": "../../../../../components/error-object.json"
53+
"$ref": "../../../../../components/error.json"
5454
}
5555
}
5656
}

backend/schema/paths/nginx/redirection-hosts/hostID/enable/post.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151
},
5252
"schema": {
53-
"$ref": "../../../../../components/error-object.json"
53+
"$ref": "../../../../../components/error.json"
5454
}
5555
}
5656
}

0 commit comments

Comments
 (0)