
Scanner and proof-of-concept exploit for CVE-2017-11467, detecting and exploiting unauthenticated Groovy function execution in OrientDB 2.2.22 and earlier via the HTTP API.

Scanner di vulnerabilità basato su YAML, veloce, con motore di rilevamento basato su template per test di sicurezza automatizzati su applicazioni web, API, reti, DNS e infrastrutture cloud.

Scanner di sicurezza per applicazioni web open-source per il rilevamento automatico delle vulnerabilità, test di penetrazione manuali e test di sicurezza delle API con un motore di intercettazione basato su proxy.

OrientDB =< 2.2.22 - Remote Code Execution
| field | value |
|---|---|
| CVE | CVE-2017-11467 |
| severity | critical |
| CVSS | 9.8 (template CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H; NVD 3.0 vector CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) |
| fixed in | OrientDB 2.2.23 (released 2017-07-11); also fixed in the 3.x line; Maven artifact com.orientechnologies:orientdb-core patched in 2.2.23 |
| class | unsandboxed server-side Groovy function execution via the HTTP API, port 2480 (NVD/template CWE-269, improper privilege management) |
| scanner version | 1.0.0 |
| python | 3.8+ stdlib only, no third-party deps |
If you want the exploit, find it here: https://satoshidisk.com/pay/CT5RZM
OrientDB through 2.2.22 does not enforce privilege requirements during
where/fetchplan/order-by use, letting a user with the default database
credentials (admin/admin) create and execute an unsandboxed
server-side Groovy function through the HTTP API (port 2480). The
Groovy function runs arbitrary JVM code - and OS commands via
Runtime/ProcessBuilder - achieving remote code execution. The
template runs a four-request flow (max-request: 4,
flow: http(1) && http(2) && http(3) && http(4)): list a database,
create a Groovy function that computes md5 of a random nonce, trigger
it, confirm code execution when the nonce's md5 is returned, and
delete the function. NVD: published 2017-07-19, CWE-269, EPSS 0.85882
(percentile 0.99728), GHSA-xm6r-4466-mr74.
The OrientDB HTTP API listens on TCP 2480 by default and the stock
databases ship the admin/admin pair (reader/writer exist as
read-only helpers). The four template requests are
GET /listDatabases (Basic YWRtaW46YWRtaW4=)
POST /document/<db>/-1:-1 ofunction JSON, groovy
POST /function/<db>/<fname> no body
DELETE /document/<db>/<rid> no body
databases;
the regex extractor "databases":\["([^"]+)" picks the first
database name.ofunction record
({"@class":"ofunction","@version":0,"@rid":"#-1:-1","idempotent":null, "name":"<fname>","language":"groovy","code":"return java.security.MessageDigest .getInstance('MD5').digest('<num>'.getBytes()).encodeHex().toString();", "parameters":null}) and must answer HTTP 201; the regex extractor
"@rid":"#([0-9]+:[0-9]+)" keeps the new record id.contains(body, md5(num)), i.e. the 32-hex digest of the nonce must
appear in the JSON answer, proving the Groovy body really executed
server-side.status_code >= 100, internal).
The payload is pure-JVM (no OS command), so it works on both Windows
and Linux hosts.NVD lists CPE cpe:2.3:a:orientdb:orientdb:* up to (including)
2.2.22; 2.2.23 and the 3.x line are patched. Remediation: upgrade to
2.2.23+, change the default admin/admin (and reader/writer)
credentials, and restrict access to ports 2480 (HTTP) and 2424
(binary).
max-request: 4), mirroring the template
flow http(1) && http(2) && http(3) && http(4).GET /listDatabases with Authorization: Basic *** (admin/admin); matchers: status 200 and body
containing databases (case-insensitive substring, nuclei word
matcher default).POST /document/<db>/-1:-1 with
Content-Type: application/json;charset=UTF-8 and the ofunction
JSON; matcher: status 201. Extractor: "@rid":"#([0-9]+:[0-9]+)".POST /function/<db>/<fname> with
Content-Type: application/json; matcher: the body contains the
32-hex md5 of the nonce (md5(num) in the template DSL).DELETE /document/<db>/<rid>; status >= 100.check(url) returns (True, details) only when probes 1-3 hold
(the template's public verdict); details keeps paths, statuses,
per-matcher flags, the chosen db, fname, nonce, rid, the
expected md5, a 200-char snippet of the function answer and the
extractor string groovy function probe: db=.. fname=.. rid=.. md5_match=B.token is computed over the JSON result so a merely
reflected page is distinguishable from a real Groovy execution.urls.txt are auto-prefixed with http://.# scanner (GitHub side): streamed CSV + optional JSON sidecar
python scanner/CVE-2017-11467/scanner.py urls.txt 8 CVE-2017-11467.csv --json CVE-2017-11467.json
# exploit (satoshidisk side): result dict + optional CSV/JSON dumps
python exploit/CVE-2017-11467/exploit.py http://127.0.0.1:2480 --csv CVE-2017-11467.csv --json CVE-2017-11467.json --verbose
urls.txt is a plain file, one target per line, # for comments.
Lines may omit the scheme (127.0.0.1:2480 works, http:// is
prepended). The HTTP API usually lives on port 2480; the binary
protocol on 2424 is not probed by this artifact.
RCE POC SUITE
scanner : CVE-2017-11467 v1.0.0
threads : 4 | csv: CVE-2017-11467.csv | json: CVE-2017-11467.json
RCE POC SUITE
[..] loaded 1 target(s) from urls.txt
[..] [1/1] http://127.0.0.1:2480 -> VULNERABLE
[..] json sidecar saved: CVE-2017-11467.json
[..] summary: total=1 vulnerable=1 not-vuln=0 errors=0
[..] timing : avg=9ms max=9ms wall=0.01s
[..] report saved: CVE-2017-11467.csv
| column | meaning |
|---|---|
| n | 1-based row number |
| url | target as provided |
| status | ok / error |
| vulnerable | verdict |
| elapsed_ms | per-target timing |
| token | md5 proof-of-match (12 chars) |
| result_b64 | base64(JSON) full details |
scanner.py - detection only, stdlib, streamed CSV + JSON sidecar.README.md - this file.DESCRIPTION.md - deeper technical notes.../../exploit/CVE-2017-11467/exploit.py - two-stage POC.| code | meaning |
|---|---|
| 0 | at least one target answered |
| 2 | every target errored (or no targets loaded) |
The POC returns 0 when its token verification passes and 2 on
verification failed.
Questo repository contiene il componente scanner per Greenbone Community Edition.