The Key the Heap Kept: Reading a Secret Out of an Actuator Heap Dump

Web & API Security Level 3/4 ~5 min November 2, 2026

The challenge

Voltaro's billing app exposes Spring Actuator. A heap dump holds what /env masks. Recover the payment API key it really uses.

What you'll learn

  • Enumerate an exposed Spring Boot Actuator from its /actuator index
  • Explain why masked /env values still leak which secrets exist
  • Extract readable strings from a binary heap dump with a pipe
  • Tell a configuration fallback from the value a service really uses
  • Lock down Actuator in production

Skills tested

Web reconnaissanceMemory forensicsSecret hunting

Prerequisites

  • Using curl
  • Shell pipes and grep

How it works

Spring Boot Actuator adds operational endpoints under /actuator. /actuator itself lists every endpoint that is exposed, so one request maps the attack surface.

Since Spring Boot 3, /actuator/env masks every value as ******. It still returns every property name and its origin, so it tells you exactly which secrets the service holds (here PSP_API_KEY, SPRING_DATASOURCE_PASSWORD, PSP_WEBHOOK_SECRET).

/actuator/heapdump returns an HPROF snapshot of the JVM heap. Masking is applied when a value is rendered as JSON, not in memory, so the heap holds the raw environment, the parsed configuration and the I/O buffers of recent HTTP calls. strings pulls the readable text out of the binary and grep finds the secret. This is the technique behind the 2024 research that recovered cloud credentials from a car maker's exposed heapdump endpoint.

Common mistakes

  • Stopping at /actuator/env. ****** is the mask, not the value.
  • Saving the dump. curl -o fails on a read-only disk: pipe it straight into strings.
  • Grepping the binary directly. grep on the raw dump only says binary file matches: run strings first, or use grep -a.
  • Taking the application.yml fallback. plk_live_E95Su8Rvq7tJA2aS0k80m7sv appears inside ${PSP_API_KEY:...}, the default Spring uses only when PSP_API_KEY is unset. The environment sets it, and the Authorization: Bearer header of the last Paylark request shows the key actually sent.
  • Taking another secret. The database password and the whsec_ webhook secret leak too, but the question is the payment API key.
  • Keeping the trailing character. A ! or # after a string is the next record's tag byte in the dump, not part of the key.

How to defend against it

  • Expose only what you need: management.endpoints.web.exposure.include=health,info.
  • Never expose heapdump (or env, configprops, threaddump) on a reachable port. Disable it with management.endpoint.heapdump.access=none.
  • Move Actuator to a separate management.server.port bound to localhost or a private network, and require authentication with Spring Security.
  • Do not keep real keys as fallbacks in application.yml: a ${VAR:default} default ships inside the jar.
  • Assume an exposed heap dump leaked every secret the process held, and rotate them all.

Full solution

Pro and Max members unlock the complete step-by-step walkthrough.

Go Pro

Community stats

104 completions
66% success rate
M2F14M3 First blood

Related Daily Hacks

40,000+ Hackers Real labs Free
Start Hacking Free or solve today's hack, no account needed