Spring Boot H2 Database RCE

By
Manieendar Mohan
Published on
16 Jun 2021

HikariCP helps applications communicate with databases. It accepts the connectionTestQuery configuration which defines the query that will be executed just before a connection is given to you from the pool to validate that the connection to the database is still alive. The matching Spring Boot environment variable is spring.datasource.hikari.connection-test-query. Whenever a new database connection is created, the value of spring.datasource.hikari.connection-test-query will be executed as an SQL query first. New database connections can be triggered in two ways. It can achieve this by restarting the app with a request to POST /actuator/restart or alteration of database connection and starting it by making multiple requests to the application.

Mitigation / Precaution

  • In order to patch this vulnerability, please install the official patch made available for supported, vulnerable instances.
Automated human-like penetration testing for your web apps & APIs
Teams using Beagle Security are set up in minutes, embrace release-based CI/CD security testing and save up to 65% with timely remediation of vulnerabilities. Sign up for a free account to see what it can do for you.

Written by
Manieendar Mohan
Manieendar Mohan
Cyber Security Lead Engineer
Find website security issues in a flash
Improve your website's security posture with proactive vulnerability detection.
Free website security assessment
Experience the power of automated penetration testing & contextual reporting.