Skip to main content
CriticalConfigOWASP A05:2021CWE-284

How to fix: Spring Boot H2 Database Console Reachable

The Spring Boot H2 in-memory/file database web console is reachable, providing direct SQL query access to the application's database.

Why it matters

The H2 console lets anyone who can reach it run arbitrary SQL against the application's database, and in many configurations can be abused to achieve remote code execution via H2's JNDI/alias functions.

Spring Boot's H2 console (spring.h2.console.enabled=true) is intended strictly for local development against an embedded database. Leaving it enabled in a deployed environment exposes a full SQL interface with no application-level access control in front of it.

How to fix it

  1. 1Set spring.h2.console.enabled=false in production configuration profiles.
  2. 2If the console must be reachable for a specific environment, restrict it to localhost or an authenticated, IP-allowlisted path.
  3. 3Rotate any credentials visible in the database if the console was reachable publicly.

Code examples

application-prod.properties

PROPERTIES
spring.h2.console.enabled=false

References

Detected automatically by VulnRadar. The check id is spring-boot-h2-console-exposed, stable across every scan so you can filter or diff on it.

See every config check

Questions

How severe is Spring Boot H2 Database Console Reachable?
VulnRadar rates this critical severity in the config category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id spring-boot-h2-console-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Spring Boot H2 Database Console Reachable map to?
It maps to CWE-284. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for spring boot h2 database console reachable

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

Spring Boot H2 Database Console Reachable fix | VulnRadar