squirrelscan
GitHub

Exposed Spring Boot Actuator: env, heapdump and other open endpoints

An open /actuator/env or /actuator/heapdump hands anyone your secrets. squirrel sends read-only GET requests to the actuator paths and flags the ones that answer.

What an exposed actuator is

Spring Boot Actuator adds management endpoints to a Java application: health checks, metrics, configuration and diagnostics. They are meant for operators. When management.endpoints.web.exposure.include=* ships to production without authentication, anyone on the internet can read them.

Some of them are a full breach in one request:

  • /actuator/env lists the application’s environment and property sources: database URLs, API keys and passwords, masked or not depending on the Spring Boot version and settings.
  • /actuator/configprops lists every configuration properties bean, which often includes the same credentials.
  • /actuator/heapdump downloads a dump of the JVM’s memory, with every secret, session and token the process holds in plain text.

Others, such as the index at /actuator and /actuator/mappings, do not leak secrets themselves but map the application’s routes and internals for an attacker.

What squirrel checks

This is a probing rule. It sends requests beyond the crawl, so it runs only when probing intensity is active or aggressive. On a passive run it sends nothing and records one skipped check.

Which paths are probed

  • Actuator base paths the audit found in your pages and scripts: a URL with an actuator path segment, such as a fetch("/manage/actuator/health") call site, gives the base /manage/actuator. Finding them sends no request.
  • The conventional base /actuator.

Every base must have the same origin as the audited URL (scheme, host and port). A path on another host is never probed. A discovered path that names a state-changing action (logout, delete, update, reset and similar, or an actuator write such as shutdown, restart or refresh), or whose call site declares POST, PUT, PATCH or DELETE, is never used. At most three bases are probed. Below aggressive, a path that robots.txt disallows is skipped.

What is sent

Only GET requests, to these fixed read-only paths under each base:

PathLevelSeverity when open
/actuator (the index)activewarning
/actuator/envactivecritical
/actuator/configpropsactivecritical
/actuator/mappingsactivewarning
/actuator/heapdumpaggressivecritical (warning when only listed by an open index)

When the index answers with its list of exposed endpoints, only the listed ones are requested. The heapdump is the exception: an aggressive run always asks for it, because it can only pass on its own answer.

An aggressive run asks for the heap dump, and an exposed server writes one when asked, which costs that server a pause and disk space, so use aggressive only on sites you run. The request carries Range: bytes=0-63 and at most 64 bytes of the answer are read, whatever the server sends, but the range does not stop the dump being written. So a run asks for at most one heap dump: any heapdump answer other than a 401, 403 or 404 (a confirmed dump, any other 2xx, a 5xx, a redirect or a failed request) ends heapdump requests for the whole run, and the other bases’ heapdumps are reported not checked. A heapdump request that times out ends them too, because a large heap can take longer than the 10 second timeout to start answering, so the timeout may mean a dump is being written. That heapdump is reported not checked, never closed. On an active run, a heapdump listed by an open actuator index is reported from that listing alone as a lower-confidence warning, and is not requested. The index lists endpoints that Spring Security still protects, so a heapdump is critical only when its HPROF header was read on an aggressive run.

Requests carry no cookies and do not follow redirects. At most 1 MB of each JSON answer is read, counted after decompression, and a compressed answer is decompressed no further than that.

Requests go one at a time, each with a 10 second timeout. A request that times out ends its base: the rest of that base’s paths are not requested. A heapdump request that times out, or gets any answer other than a 401, 403 or 404, also ends heapdump requests under every other base. The whole rule stops after 30 seconds, whatever is left of the shared probe budget, so a site that hangs on every path adds at most 30 seconds to the audit. A 429 answer or a bot or WAF challenge stops the rule: no further request is sent. A server error (5xx) leaves that path not checked.

How an endpoint is confirmed

A status code alone never counts, so a single-page app that answers every path with its 200 page is not a finding. An endpoint counts only when its 2xx answer has that endpoint’s shape:

  • The index: a JSON _links object with a self link and at least one known actuator endpoint.
  • env: activeProfiles and propertySources arrays.
  • configprops: contexts holding beans with a prefix and properties.
  • mappings: contexts holding mappings with dispatcher servlets, dispatcher handlers or servlet filters.
  • heapdump: a body that starts with the HPROF header JAVA PROFILE, or, for the gzipped dump Spring Boot 1.x sends, the gzip magic bytes with a Content-Disposition naming a .hprof or .hprof.gz file. Gzip bytes without that file name are not checked.

A JSON answer longer than 1 MB counts when its opening matches the shape, for example an env answer that starts with {"activeProfiles":[ and names propertySources.

Results

Findings name the endpoint and the kind of evidence only. squirrel never stores or reports a response body or any value from it.

The rule gives two independent verdicts, each with its own checks: one for the index, env, configprops and mappings, and one for the heapdump. A pass clears only what that run requested and got a definite answer for. An active run never asks for a heap dump, so its pass for the other endpoints never clears a heap dump an earlier aggressive run found.

  • exposed-actuator-critical (fail) lists the open env and configprops endpoints. The check details carry severity: "critical". Each item has endpoint and evidence (env-property-sources or configprops-beans).
  • exposed-actuator-endpoints (warn) lists the open index and mappings endpoints, with evidence actuator-index-links or request-mappings.
  • exposed-actuator (pass) when the index, env, configprops and mappings were requested under every base and each got a definite answer (anything but a timeout, a network error, a 5xx, a 429 or a challenge) with no actuator shape. A path that robots.txt disallowed, or that the run did not reach, means no pass.
  • exposed-actuator-not-checked (skipped) names the index, env, configprops or mappings paths that were not checked and why. The reason is probing-passive on a passive run, robots-disallowed when robots.txt disallowed them below aggressive, probe-budget when the shared probe budget ran out, probe-errors when every request failed, and probe-incomplete otherwise: a 429 or bot challenge, a base that timed out, a failed request, a 5xx, the 30 second limit, or more than three bases. It can appear beside a finding.
  • exposed-actuator-heapdump (fail) when an aggressive run read the HPROF header, with severity: "critical" in the details and evidence hprof-header, or hprof-gzip for a gzipped .hprof attachment. On an active run, a heapdump an open index lists is a warning with evidence listed-in-index and confidence: "lower".
  • exposed-actuator-heapdump-closed (pass) only when an aggressive run got a 401, 403 or 404 for the heapdump under every base. A 2xx without the HPROF header, a redirect or any other answer is not a pass.
  • exposed-actuator-heapdump-not-checked (skipped) on every active run (reason probe-level-too-low), and on an aggressive run that did not get a definite answer for every base’s heapdump. Its message names each heapdump that was not checked and why, including “the request timed out; an open endpoint may have started writing a dump” and the heapdumps not requested because a heap dump was already confirmed or an earlier heapdump request timed out or got another answer. It can appear beside an exposed-actuator-heapdump finding.

Limits

An actuator base the crawl never referenced and that is not at /actuator is not found, and neither are Spring Boot 1.x endpoints at the application root (/env, /heapdump). Endpoints open only to signed-in users are not seen, because the probes carry no cookies. Other actuator endpoints, such as threaddump, loggers or jolokia, are not requested; an open index lists them, so check the index finding’s endpoint by hand.

How to fix it

Expose only what you need over HTTP, and nothing sensitive:

management.endpoints.web.exposure.include=health,info

Never use * in production. Put any other endpoint behind Spring Security, or serve the actuator on a separate port that is not reachable from the internet with management.server.port. If env, configprops or heapdump was open, treat every secret the application holds as leaked and rotate it: database passwords, API keys, signing keys and cloud credentials.

Rule IDsecurity/exposed-actuator
CategorySecurity
ScopeSite-wide
Severityerror
Weight9/10

Enable / disable

Disable this rule

[rules]
disable = ["security/exposed-actuator"]

Disable all Security rules

[rules]
disable = ["security/*"]

Enable only this rule

[rules]
enable = ["security/exposed-actuator"]

enable replaces the default ["*"], so this is the only rule selected. Leave disable out: a rule that matches any disable pattern is skipped even when enable names it. Only an enabled setting under a rule’s own [rule_options] table overrides both lists.

Check names by outcome

Each check name this rule can emit, by what it means to a tool comparing two audits. A problem check is a finding. A clean check says the rule ran over what it covers and found nothing; it clears the problem checks listed beside it, so a finding is fixed when the rule ran over the same scope and a clean check took its place. A not checked check says the rule did not evaluate, and never clears a finding.

Check nameOutcomeClears
exposed-actuator-criticalProblem
exposed-actuator-endpointsProblem
exposed-actuatorCleanexposed-actuator-critical, exposed-actuator-endpoints
exposed-actuator-not-checkedNot checked
exposed-actuator-heapdumpProblem
exposed-actuator-heapdump-closedCleanexposed-actuator-heapdump
exposed-actuator-heapdump-not-checkedNot checked

Type to search…

↑↓ navigate↵ openesc close