Skip to content

Commit 205d446

Browse files
committed
fix(security): restore loopback-only server defaults in packaged config
server_schema.py was hardened to default host=127.0.0.1 and cors.origins=["http://localhost:8000"], but default_config.json — the lowest-precedence base config layer that overrides schema defaults — still shipped host="0.0.0.0" and cors.origins=["*"], silently defeating the hardening for every deployment using the packaged defaults. Align both default_config.json files (packaged + repo sample) with the secure schema defaults. Operators binding to 0.0.0.0 for network exposure must now set host + cors.origins + trusted_hosts explicitly.
1 parent b9281b7 commit 205d446

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

config/default_config.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,15 @@
211211
},
212212
"server": {
213213
"enabled": false,
214-
"host": "0.0.0.0",
214+
"host": "127.0.0.1",
215215
"port": 8000,
216216
"workers": 1,
217217
"reload": false,
218218
"docs_enabled": true,
219219
"docs_url": "/docs",
220220
"redoc_url": "/redoc",
221221
"openapi_url": "/openapi.json",
222+
"trusted_hosts": ["localhost", "127.0.0.1", "::1", "testserver"],
222223
"auth": {
223224
"enabled": false,
224225
"strategy": "none",
@@ -231,7 +232,7 @@
231232
"cors": {
232233
"enabled": true,
233234
"origins": [
234-
"*"
235+
"http://localhost:8000"
235236
],
236237
"methods": [
237238
"GET",
@@ -275,4 +276,4 @@
275276
"tag": ""
276277
}
277278
}
278-
}
279+
}

src/orb/config/default_config.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,15 @@
203203
},
204204
"server": {
205205
"enabled": false,
206-
"host": "0.0.0.0",
206+
"host": "127.0.0.1",
207207
"port": 8000,
208208
"workers": 1,
209209
"reload": false,
210210
"docs_enabled": true,
211211
"docs_url": "/docs",
212212
"redoc_url": "/redoc",
213213
"openapi_url": "/openapi.json",
214+
"trusted_hosts": ["localhost", "127.0.0.1", "::1", "testserver"],
214215
"auth": {
215216
"enabled": false,
216217
"strategy": "none",
@@ -223,7 +224,7 @@
223224
"cors": {
224225
"enabled": true,
225226
"origins": [
226-
"*"
227+
"http://localhost:8000"
227228
],
228229
"methods": [
229230
"GET",
@@ -254,7 +255,7 @@
254255
"recovery_timeout": 60,
255256
"half_open_max_calls": 3
256257
},
257-
"resource": {
258+
"resource": {
258259
"prefixes": {
259260
"default": "",
260261
"request": "req-",
@@ -267,4 +268,4 @@
267268
"tag": ""
268269
}
269270
}
270-
}
271+
}

0 commit comments

Comments
 (0)