How i Manage to Get Sensitive Informations via docker image
The author found that public Docker images for GCash services contained database credentials and SSH keys in their environment variables and source code. An attacker could extract these secrets and potentially access production databases and servers.
Published on ph-hitachi.medium.com
Ph.Hitachi
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
Globe Telecom runs a public vulnerability disclosure programme, and its GCash-branded services are published as container images under the Docker Hub user gcashsupport. The researcher's target here is not a web endpoint but the public image registry itself: the images that back GCash microservices, including a login gateway and internal tools.
The technique is what the author calls a passive attack: finding exposed data by browsing and crawling public resources without sending traffic to the target's own services, as opposed to active testing that can trigger security alerts on the target side. The premise is that companies automate their processes with load balancing, CI/CD and containerisation, and that this automation sometimes leaves sensitive material in public places.
Setup
The only tooling described is Docker, a local environment running WSL, and JD-GUI for decompiling Java. No accounts, roles or special access were needed: Docker Hub images are public, and pulling them requires nothing more than a Docker client. The researcher had spent two years away from bug bounty and was hunting on public programmes.
Finding it
The starting point was a search on Docker Hub for the term gcash. The search returned 43 results, and the owner of the matching repositories appeared to be legitimate and to belong to GCash.
Among those results the author picked gcashsupport/ms-login because it looked more interesting than the others: a login service is most likely a gateway to other services. Reviewing the tags and the image layers showed that a production database was included in the image, and that the database was an Amazon Relational Database Service (RDS) instance.
Exploitation
Step 1: Pull and run the image
The image was pulled to the local environment and a container was started from it:
docker run -d gcashsupport/ms-login:1.0
Step 2: Inspect the environment variables
The environment of the running container was read with:
docker exec -it 17dc3eacc43b env
Only DB_HOST was present in the environment. There was no username and no password. The reasoning at this point was that if the host is baked into the image, the credentials must be somewhere in the container too, most likely in the source code.
Step 3: Look at the files in the container
Listing the files showed a login.jar of 39614761 bytes. The other files were empty or default, at 4096 bytes, which indicated that login.jar was the only real content uploaded to this image. Running the jar confirmed it was a Spring Boot application.
Step 4: Decompile the jar
Because the researcher was working only in WSL, the jar was downloaded from the container to the local machine with a Docker command and then decompiled with JD-GUI. The decompiled output exposed database credentials in:
src/main/resources/application.properties
Step 5: Check the other images
With the container effectively compromised, the author moved on to the other images under the gcashsupport user. Some of those images were actively maintained, with the last update only a day old. Every publicly accessible image under that user had a database configured inside the image in a way that could be exposed.
Some of the other images also contained SSH keys. In principle those keys would allow logging in to the server where the container was deployed, but the author judged them useless for that purpose: the credentials sit inside an isolated container, so reaching them remotely is similar to accessing the image pulled locally.
One further image, gcashsupport/lendingeligibilitytool, contained credentials for the GCash Master Card and Gift Card databases together with a gscore computation API endpoint.
Affected images
The report lists these repositories:
- gcashsupport/ackerman-tool:*
- gcashsupport/ms-biller-maintenance:*
- gcashsupport/ms-tl-pass:*
- gcashsupport/ms-jarvis:*
- gcashsupport/ms-powerpay-approval:*
- gcashsupport/ms-bank-maintenance :*
- gcashsupport/ms-login:*
- gcashsupport/ms-ipy-send:*
- gcashsupport/lendingeligibilitytool:*
Each service has its own dedicated database, and some services, such as gcashsupport/lendingeligibilitytool, use multiple database connections. The services appear to be microservices for Globe Powerpay, GCash Master Card and GCash Gift Card, plus internal tools such as Inter-Peer Yield (ipy) and ackerman.
Root cause
The mistake is packaging: production configuration, including database connection details, was baked into images that were pushed to a public registry. The environment variables alone did not carry the credentials, but the Spring Boot application inside login.jar did, in application.properties, so anyone who pulled the image could read them after decompiling. The same pattern, database configuration inside the image, was present across the public repositories under the account. The registry was public, so anyone could pull the images. the isolation of a container limits what leaked SSH keys can reach, but it does nothing to protect credentials that are readable inside the image itself.
Impact
An unauthenticated person browsing Docker Hub could obtain database credentials for production RDS instances behind GCash services, including the Master Card and Gift Card databases, and an internal API endpoint for gscore computation. The author states that all publicly accessible images under the account had database configuration that could be exposed. The SSH keys found in other images are explicitly described as of limited use because they live inside an isolated container. The report does not show any query run against the databases, so the practical reach of the credentials beyond their disclosure is not demonstrated.
Fix
The remediation happened in stages, as recorded in the timeline:
- 18 March 2024: initial report.
- 25 March 2024: triaged.
- April 2024: initial fix, removing some public images.
- April 2024: fixed again, with public images returning under new versions and tags.
- 18 April 2024: final fix, with all image repositories made private permanently.
The durable fix is the last one: keeping the repositories private so that configuration and credentials inside the images are no longer downloadable by anyone. The intermediate step of removing images and republishing under new tags was followed by a final fix that made the repositories private.
Variants to test
- Search public registries for organisation names and product names, then inspect tags and layers. A positive result is an image whose layers or configuration reference production infrastructure such as a managed database host.
- Pull an image and read its environment with
docker exec -it <id> env. A positive result is any host, endpoint or account identifier that points at production. - Decompile application archives found in the image and read configuration files such as
application.properties. A positive result is a plaintext username and password for a live service. - Look for SSH keys or other credential files in image layers. A positive result is a private key, though its usefulness depends on whether it can reach anything outside the container.
- Check whether repositories that were taken down reappear under new tags or versions. A positive result is the same sensitive content published again after a reported fix.
Timeline
| Date | Event |
|---|---|
| 18 March 2024 | Initial report |
| 25 March 2024 | Triaged |
| April 2024 | Initial fix (some public images removed) |
| April 2024 | Fixed (public images again with new version/tags) |
| 18 April 2024 | Final fix (all image repositories private permanently) |
The author notes that the programme does not offer a monetary reward, and that the work took two days and uncovered what they call the most critical bugs on GCash and Globe Telecom after the VDP was announced.
What happened, in plain words
A security researcher found that a large company had published pieces of its internal software on a public website, in a form anyone could download. Inside those downloads were the passwords and addresses needed to reach the company's production databases, including databases behind payment card products. Nobody had to break into anything: the material was simply sitting in a public place, and the researcher read it.
The company is Globe Telecom, which runs a public vulnerability disclosure programme. A vulnerability disclosure programme (VDP) is a set of rules a company publishes saying "if you find a security problem in our systems, tell us here, and here is what we promise in return". It is not the same as a bug bounty, which pays money for reports. The author notes this programme does not offer a monetary reward.
The software was published as container images under a Docker Hub account named gcashsupport. GCash is the company's mobile wallet brand. To understand the rest, you need three ideas.
A container image is a packaged bundle of a program plus everything it needs to run: the program files, settings, and sometimes helper tools. Think of it as a sealed lunchbox containing a meal and the recipe. A container is that lunchbox opened and running on a machine. Docker is the most common tool for building and running these lunchboxes, and Docker Hub is a public website where people upload images so others can download them. Many images on Docker Hub are public by design: anyone can download them, no account needed.
The researcher's approach is what the author calls a passive attack: finding exposed data by only browsing and crawling public resources, without sending any traffic to the target's own services. The opposite is an active attack, such as automated testing that sends requests to the company's servers and can trigger security alerts on their side. The reasoning is that companies automate their work with load balancing, CI/CD (automated build and deployment pipelines) and containerisation, and that this automation sometimes leaves sensitive material in public places.
The author had been away from bug bounty work for two years and was hunting on public programmes. Several valid bugs, including critical ones, had been marked as duplicates, meaning someone else reported them first. That is the motivation for looking somewhere less crowded: not the company's websites, but the public places where its software is stored.
Finding it
The starting point was a search on Docker Hub for the term gcash. The search returned 43 results, and the owner of the matching repositories appeared to be legitimate and to belong to GCash. A repository on Docker Hub is a named collection of images, usually one per piece of software, with different versions stored as tags (labels such as 1.0 or latest).
Among those results the author picked gcashsupport/ms-login because it looked more interesting than the others: a login service is most likely a gateway to other services. In other words, if you can read the settings of the thing that checks who may come in, you may learn how the rest of the building is wired.
Reviewing the tags and the image layers showed that a production database was included in the image, and that the database was an Amazon Relational Database Service (RDS) instance. An image layer is one slice of the packaged image; images are built in layers, and each layer can be inspected separately, a bit like peeling an onion and reading each skin. Amazon RDS is Amazon's managed database service: the company rents a database from Amazon instead of running its own server. "Production" means the live system that real customers use, not a test copy.
Exploitation
Step 1: Pull and run the image
The image was pulled to the local environment and a container was started from it:
docker run -d gcashsupport/ms-login:1.0
Line by line:
dockeris the program being called.runtells Docker to create and start a container from an image.-dmeans "detached": run it in the background and give the terminal back, instead of tying up the window with the program's output.gcashsupport/ms-login:1.0is the image name.gcashsupportis the account,ms-loginis the repository, and:1.0is the tag, that is, which version to use.
Why this step: downloading ("pulling") the image and starting it locally gives the researcher a private copy to inspect, without touching the company's servers at all. This is the passive part: the only party contacted is Docker Hub, the public shop.
Step 2: Inspect the environment variables
The environment of the running container was read with:
docker exec -it 17dc3eacc43b env
Line by line:
docker execmeans "run a command inside a container that is already running".-itcombines two options:-ikeeps the input open and-tgives a terminal-like display, so the output is readable interactively.17dc3eacc43bis the identifier of the container, a short code Docker assigned when the container started.envis the command being run inside the container. It prints the environment variables, which are named settings a program reads when it starts, such as where its database lives.
Only DB_HOST was present in the environment. DB_HOST is the address of the database server. There was no username and no password. The reasoning at this point was that if the host is baked into the image, the credentials must be somewhere in the container too, most likely in the source code. "Baked in" means written into the image when it was built, so every copy carries it.
Why this step: environment variables are the easiest place to look for settings, and they are quick to read. Finding the database address but not the password tells you the password is stored somewhere else, which narrows the search.
Step 3: Look at the files in the container
Listing the files showed a login.jar of 39614761 bytes. The other files were empty or default, at 4096 bytes, which indicated that login.jar was the only real content uploaded to this image. A jar is a Java archive: a single file that bundles a Java program and its resources, like a zip file for Java. Running the jar confirmed it was a Spring Boot application. Spring Boot is a popular framework for building Java web services; one of its conventions is that settings live in a file called application.properties.
Why this step: if the settings are not in the environment, they are probably inside the program itself. The file sizes are the clue: a 39 MB jar next to 4 KB placeholder files means the jar is where the substance is.
Step 4: Decompile the jar
Because the researcher was working only in WSL, the jar was downloaded from the container to the local machine with a Docker command and then decompiled with JD-GUI. WSL is Windows Subsystem for Linux, a way to run a Linux environment inside Windows. Decompiling means turning a compiled program back into readable source code, roughly like turning a cooked cake back into the recipe. JD-GUI is a free tool that does this for Java programs.
The decompiled output exposed database credentials in:
src/main/resources/application.properties
Line by line, this is a file path inside the program's source tree:
src/main/resourcesis the standard folder where a Java project keeps non-code resources.application.propertiesis the Spring Boot settings file, a plain list ofname=valuelines.
Why this step: the settings file is where a Spring Boot application keeps its database username and password. Decompiling makes that file readable, and because the file was inside a public image, anyone who downloaded the image could do the same.
Step 5: Check the other images
With the container effectively compromised, the author moved on to the other images under the gcashsupport user. Some of those images were actively maintained, with the last update only a day old. Every publicly accessible image under that user had a database configured inside the image in a way that could be exposed.
Some of the other images also contained SSH keys. SSH is the standard way to log in to a remote server over an encrypted connection; an SSH key is a file that proves who you are, like a key to a door, so anyone holding it can log in without a password. In principle those keys would allow logging in to the server where the container was deployed, but the author judged them useless for that purpose: the credentials sit inside an isolated container, so reaching them remotely is similar to accessing the image pulled locally. Isolation here means the container is a sealed box: what is inside it does not automatically give you a way out to the machine hosting it.
One further image, gcashsupport/lendingeligibilitytool, contained credentials for the GCash Master Card and Gift Card databases together with a gscore computation API endpoint. An API is a way for one program to talk to another, like a service counter where you hand over a request and get an answer back. An endpoint is one specific address at that counter. "gscore" is the name used in the report for a computation the service performs; the report does not explain what the score measures.
Affected images
The report lists these repositories:
- gcashsupport/ackerman-tool:*
- gcashsupport/ms-biller-maintenance:*
- gcashsupport/ms-tl-pass:*
- gcashsupport/ms-jarvis:*
- gcashsupport/ms-powerpay-approval:*
- gcashsupport/ms-bank-maintenance :*
- gcashsupport/ms-login:*
- gcashsupport/ms-ipy-send:*
- gcashsupport/lendingeligibilitytool:*
Each service has its own dedicated database, and some services, such as gcashsupport/lendingeligibilitytool, use multiple database connections. The services appear to be microservices for Globe Powerpay, GCash Master Card and GCash Gift Card, plus internal tools such as Inter-Peer Yield (ipy) and ackerman. A microservice is a small program that does one job and talks to other small programs, like separate counters in one office instead of one person doing everything.
Root cause
The mistake is packaging: production configuration, including database connection details, was baked into images that were pushed to a public registry. The environment variables alone did not carry the credentials, but the Spring Boot application inside login.jar did, in application.properties, so anyone who pulled the image could read them after decompiling. The same pattern, database configuration inside the image, was present across the public repositories under the account.
The registry was public, so anyone could pull the images. In plain terms: the company treated the images as ordinary software to share, not as documents that might contain secrets. The isolation of a container limits what leaked SSH keys can reach, but it does nothing to protect credentials that are readable inside the image itself. A sealed lunchbox protects the food from the outside, but it does not help if the recipe printed on the lid is the secret.
Impact
An unauthenticated person browsing Docker Hub could obtain database credentials for production RDS instances behind GCash services, including the Master Card and Gift Card databases, and an internal API endpoint for gscore computation. "Unauthenticated" means without logging in anywhere. The author states that all publicly accessible images under the account had database configuration that could be exposed. The SSH keys found in other images are explicitly described as of limited use because they live inside an isolated container. The report does not show any query run against the databases, so the practical reach of the credentials beyond their disclosure is not demonstrated.
Fix
The remediation happened in stages, as recorded in the timeline:
- 18 March 2024: initial report.
- 25 March 2024: triaged. "Triaged" means the receiving team reviewed the report and accepted it as valid.
- April 2024: initial fix, removing some public images.
- April 2024: fixed again, with public images returning under new versions and tags.
- 18 April 2024: final fix, with all image repositories made private permanently.
The durable fix is the last one: keeping the repositories private so that configuration and credentials inside the images are no longer downloadable by anyone. The intermediate step of removing images and republishing under new tags was followed by a final fix that made the repositories private. Think of taking a poster down from a noticeboard but leaving the same poster in a drawer that anyone can open: the second fix is locking the drawer.
Variants to test
- Search public registries for organisation names and product names, then inspect tags and layers. A positive result is an image whose layers or configuration reference production infrastructure such as a managed database host.
- Pull an image and read its environment with
docker exec -it <id> env. A positive result is any host, endpoint or account identifier that points at production. - Decompile application archives found in the image and read configuration files such as
application.properties. A positive result is a plaintext username and password for a live service. "Plaintext" means not encrypted or hidden in any way. - Look for SSH keys or other credential files in image layers. A positive result is a private key, though its usefulness depends on whether it can reach anything outside the container.
- Check whether repositories that were taken down reappear under new tags or versions. A positive result is the same sensitive content published again after a reported fix.
Timeline
| Date | Event |
|---|---|
| 18 March 2024 | Initial report |
| 25 March 2024 | Triaged |
| April 2024 | Initial fix (some public images removed) |
| April 2024 | Fixed (public images again with new version/tags) |
| 18 April 2024 | Final fix (all image repositories private permanently) |
The author notes that the programme does not offer a monetary reward, and that the work took two days and uncovered what they call the most critical bugs on GCash and Globe Telecom after the VDP was announced.
Glossary
- API: a way for one program to talk to another, like a service counter where you hand over a request and get an answer.
- API endpoint: one specific address at that counter, where a particular request is answered.
- Active attack: testing that sends traffic to the target's own services and can trigger security alerts on their side.
- Amazon RDS: Amazon's managed database service, where a company rents a database instead of running its own server.
- Baked in: written into an image when it was built, so every copy of the image carries it.
- Bug bounty: a programme that pays money for security reports.
- CI/CD: automated build and deployment pipelines that move software from code to running systems.
- Container: a running instance of a container image, isolated from the machine hosting it.
- Container image: a packaged bundle of a program plus its settings and dependencies, stored as layers.
- Containerisation: the practice of packaging and running software in containers.
- Credentials: the username and password (or key) needed to log in to something.
- Decompile: turn a compiled program back into readable source code.
- Docker: the most common tool for building and running container images.
- Docker Hub: a public website where container images are uploaded and downloaded.
- Duplicate: a report for a bug someone else already reported.
- Environment variables: named settings a program reads when it starts, such as where its database lives.
- Image layer: one slice of a container image; images are built in layers and each can be inspected.
- Isolation: the property of a container being a sealed box, so what is inside does not automatically give access to the host machine.
- Jar: a Java archive, a single file bundling a Java program and its resources.
- JD-GUI: a free tool that decompiles Java programs.
- Microservice: a small program that does one job and talks to other small programs.
- Passive attack: finding exposed data by only browsing and crawling public resources, without sending traffic to the target's services.
- Plaintext: not encrypted or hidden in any way.
- Production: the live system real customers use, as opposed to a test copy.
- Repository: a named collection of images on Docker Hub, usually one per piece of software.
- Spring Boot: a popular framework for building Java web services, which keeps settings in
application.properties. - SSH key: a file that proves who you are when logging in to a remote server, like a key to a door.
- Tag: a label on an image version, such as
1.0orlatest. - Triaged: reviewed by the receiving team and accepted as a valid report.
- Unauthenticated: without logging in anywhere.
- VDP (vulnerability disclosure programme): published rules for reporting security problems to a company, with stated commitments in return.
- WSL: Windows Subsystem for Linux, a way to run a Linux environment inside Windows.