How a Forgotten Legacy JS File Landed Me My First Bug Bounty
A publicly listable cloud storage bucket hosted an old JavaScript bundle that contained hardcoded environment variables, including keys and a secret. The reporter claimed an attacker could potentially forge signatures or manipulate requests, but the vendor found the keys were unused or semi-public and could not be used to compromise user data.
Bug Bounty
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
Vidio.com runs a Smart TV application, and its static assets are hosted on a subdomain dedicated to that application. During reconnaissance the researcher found that this host was backed by a Google Cloud Storage (GCS) bucket with bucket listing enabled, so the root URL returned an XML tree listing every object in the bucket rather than a normal web page.
Among the static assets was a JavaScript bundle whose filename contained the word legacy. The bundle was an older build of the Smart TV front end, no longer part of the active deployment. and because the application is built with Create React App, any environment variable prefixed with REACT_APP_ is embedded directly into the final static JavaScript bundle at build time. That is the normal, intended behaviour of the framework: the prefix marks a variable as safe to ship to the browser. The problem is what happens when a developer puts a sensitive value behind that prefix in a .env file, because the value then goes straight to the public.
Setup
The work needed no accounts, roles or special tooling beyond a browser and a shell. The researcher used curl to download the bundle and grep to search it, then wrote a small Node.js script as a proof of concept. The open bucket listing is what made the legacy bundle discoverable by browsing.
Finding it
While doing recon on Vidio.com, the researcher came across a subdomain used to host static assets for the Smart TV application. Opening the root URL in a browser returned the classic XML tree that appears when a GCS bucket has listing enabled.
Rather than running automated scanners against it, the researcher scrolled through the XML file list by hand to understand what was hosted there. One filename stood out:
assets/assets/.....js
The reasoning is the one that applies to any recon: filenames containing legacy, old, backup or dev deserve attention. Developers tend to tighten security on their latest production builds, but old build artifacts left in a storage bucket often still contain mistakes from earlier versions.
Exploitation
Step 1: Download the bundle and search for baked-in variables
The researcher downloaded the JavaScript bundle and checked whether any environment variables had been embedded during the build. The one-liner used was:
curl -s "https:.....js" -o vidio_leaked.jsgrep -o 'REACT_APP_[A-Z_]*:"[^"]*"' vidio_leaked.js
The curl call fetches the bundle and writes it to vidio_leaked.js; the grep call then extracts every REACT_APP_ assignment of the form NAME:"value" from the downloaded file. The output was:
REACT_APP_FLAVOUR:"production"REACT_APP_SENTRY_DSN:"https://7....."REACT_APP_HMAC_SECRET:"V1..."REACT_APP_MUX_API_KEY:"v..."REACT_APP_SK_ID:"...."REACT_APP_SK:"KS...."REACT_APP_RELEASE_VERSION:""REACT_APP_SHORT_HASH:""
The build was marked production, and alongside it came a Sentry DSN, an HMAC secret, a Mux API key, a key ID and a secret key. The researcher noted that REACT_APP_SK held a 32-byte Base64 string, and that seeing REACT_APP_HMAC_SECRET and that secret key in a production build looked like a significant find.
Step 2: Write a proof of concept for the triage team
To make triage as easy as possible, the researcher wrote a Node.js script that fetches the bundle and parses out the exposed keys with regular expressions:
const https = require('https');
const VULNERABLE_URL = 'https:
https.get(VULNERABLE_URL, (res) => { let data = ''; res.on('data', chunk => data += chunk); res.on('end', () => { const secrets = { 'HMAC_SECRET': data.match(/REACT_APP_HMAC_SECRET:"([^"]+)"/), 'SK (Secret Key)': data.match(/REACT_APP_SK:"([^"]+)"/), 'SK_ID': data.match(/REACT_APP_SK_ID:"([^"]+)"/), 'MUX_API_KEY': data.match(/REACT_APP_MUX_API_KEY:"([^"]+)"/), 'SENTRY_DSN': data.match(/REACT_APP_SENTRY_DSN:"([^"]+)"/) };
for (const [name, match] of Object.entries(secrets)) { if (match) { console.log(`${name}: ${match[1]}`); } } });}).on('error', console.error);
The script issues a GET for the bundle, accumulates the response body, and runs one regex per secret name against it. Each regex captures the value between the quotes after the variable name, and the loop prints every name whose regex matched. The script only demonstrates exposure; it does not attempt to use any of the keys.
Step 3: Submit with a severity assessment
The report was rated High. The reasoning was that if the HMAC_SECRET and SK were used to sign API requests or tokens without strict server-side checks, an attacker could potentially forge signatures or manipulate requests. The report was sent by email to [redacted] on 8 February 2026.
Step 4: Triage and the final verdict
Two days later, on 10 February, the Vidio Security team replied confirming they were validating the report. The final verdict arrived on 19 February and downgraded the finding:
- Unused legacy artifact. The bundle came from an older build that was no longer used in the active deployment. In the current production system those variables were no longer exposed in the same way.
- Defence in depth on the server side. Even with the keys exposed, Vidio had additional server-side validation layers. The keys were considered public or semi-public client identifiers by design, such as the Mux analytics key and the Sentry DSN, and could not be used on their own to compromise user data or take over accounts.
The team's closing message acknowledged that the report had helped identify legacy files that had not yet been cleaned up in the storage bucket, that old assets were being cleaned up and the keys rotated as a preventive measure, and that under their reward policy the report was categorised as Informational but Useful, with a bounty awarded as a token of appreciation for responsible disclosure.
Root cause
The immediate cause is that an older Create React App build embedded sensitive-looking values behind the REACT_APP_ prefix, which by design inlines them into the public bundle. The deeper cause is lifecycle: an old build artifact was left in a storage bucket that allowed anonymous listing, so a bundle that was no longer part of the live deployment remained publicly discoverable and downloadable.
Existing defences did not stop the exposure of the file itself, because nothing removed the legacy object or restricted the listing. They did limit the consequences: the keys were not usable on their own against the live system, and the current production deployment no longer exposed the variables in the same way. The report does not describe the server-side validation layers beyond stating that they existed.
Impact
Under the conditions the researcher assumed, a usable HMAC_SECRET or secret key could let an attacker forge signatures or manipulate requests. In practice, per the vendor's triage, the exposed values were client identifiers that could not be used alone to compromise user data or take over accounts, and the bundle was not part of the active deployment. The concrete outcome was hygiene: the report surfaced legacy files that had not been cleaned from the bucket, prompting cleanup and key rotation.
Fix
The vendor stated that old assets were being cleaned up in the storage bucket and that the keys were being rotated as a preventive measure. Those are the changes the vendor said it was carrying out. The general lesson from the report is to keep build artifacts out of publicly listable storage and to treat anything behind REACT_APP_ as public before it is committed to a .env file.
Variants to test
- Listable buckets on other targets. Request the root of asset and static hosts and look for an XML listing. A positive result is a full object listing, which you can then scan for interesting filenames.
- Legacy, old, backup and dev filenames. Search listings and bundles for those tokens. A positive result is an older bundle that still contains configuration the current build has removed.
REACT_APP_extraction on any Create React App bundle. Run the samegreppattern against downloaded bundles. A positive result is any assignment whose value looks like a credential rather than a public identifier.- Verify what a key actually does before rating it. Test whether the key can sign, authenticate or read anything on the live system. A positive result is a request that succeeds only because of the extracted key; without that, report it as a potential exposure rather than a critical finding.
- Report structure. Provide several reproduction paths, such as the browser,
curland the bucket listing, plus a ready-to-run script. A positive result is a faster, cleaner triage even when the severity is downgraded.
What happened, in plain words
A security researcher spent time looking at a company's website, the way you might walk around a building and check which doors are unlocked. The company, Vidio, runs a streaming service and also has an app for Smart TVs. The files that make that TV app work (images, code, and so on) are stored on a separate web address, a subdomain, that exists only to serve those files.
When the researcher opened the main address of that file store in a browser, instead of a normal web page they got a plain list of every file inside it. That is like finding a warehouse whose front door is open and whose shelves are all labelled. While scrolling through that list by hand, they noticed a file whose name contained the word legacy, meaning an old leftover version. They downloaded it and searched inside it for settings that developers sometimes accidentally leave in code that gets sent to the public.
They found several values that looked like secret keys. They wrote a small script that pulls those values out automatically, rated the problem as serious, and emailed the company. The company replied that the file was an old build no longer in use, and that the keys were considered public or semi-public client identifiers by design, so the risk was much lower than the researcher had thought. Even so, the company thanked them, said it was cleaning up the old files and rotating the keys, and paid a reward.
This is a story about a first reward, and about how a finding that turns out to be low risk can still be genuinely useful. Below, every step is explained from scratch, assuming you can use a browser and a computer and nothing else.
Why you should never ignore legacy.js files during recon
"Recon", short for reconnaissance, is the looking-around phase of security testing: before you try anything clever, you first work out what a company has on the internet, what addresses it uses, and what files it serves. It is the same idea as walking around a house before trying the doors.
A "bug bounty" is a programme where a company says: if you find a security problem in our systems and tell us privately, we will pay you. A "bounty" is that payment. A "duplicate" is when someone else already reported the same thing, so yours does not count. A "false positive" is when you think you found a problem but you are wrong.
Every bug hunter remembers their first valid bounty. Before that first payout, you spend hours staring at terminal screens, second-guessing your recon, and wondering if every finding is just a false positive or a duplicate.
In February 2026, the researcher finally broke the seal. It was not a flashy remote code execution (RCE) or a complex account takeover. RCE means running your own commands on someone else's computer, and account takeover means logging in as another person. Instead, it came down to bug bounty basics: checking an open cloud storage bucket and digging through an old, forgotten JavaScript file.
A "cloud storage bucket" is a folder in the cloud, run by a company such as Google, where a business keeps files. "JavaScript" is the programming language that web pages run inside your browser; a "JavaScript file" is a text file full of instructions that the browser downloads and executes. "Hardcoded" means a value written directly into the file by hand, rather than fetched from somewhere safe at run time. "Environment variables" are settings a program reads when it starts, such as which server to talk to or which key to use.
Here is the story of how the researcher found hardcoded environment variables in Vidio's Smart TV application, how the "High" severity report got downgraded to "Informational", and why the security team still rewarded them Rp …. for it. "Severity" is how serious a problem is judged to be; "Informational" is the lowest label, meaning roughly "worth knowing, not dangerous". "Rp" is the Indonesian rupiah.
The Recon: An Open Bucket and a "Legacy" Clue
While doing recon on Vidio.com, the researcher stumbled across a subdomain used to host static assets for their Smart TV application: ......vidio.com. A "subdomain" is a prefix on a domain name: if vidio.com is the main building, something.vidio.com is a side entrance. "Static assets" are files that do not change per visitor: pictures, fonts, and code bundles.
When the researcher opened the root URL in a browser, they were greeted by that classic XML tree every bug hunter loves to see: Google Cloud Storage (GCS) bucket listing was enabled. "XML" is a text format for structured data, made of tags in angle brackets. A "bucket listing" is a setting that, when switched on, makes the storage answer with a list of every file it holds instead of refusing or showing a web page. Google Cloud Storage is Google's file-storage service.
Instead of blindly running heavy automated scanners, the researcher scrolled through the XML file list manually to understand what was hosted there. An automated scanner is a program that probes thousands of addresses for you; it is fast but noisy, and it does not understand context. Reading the list by hand is slower but lets you notice odd names. Among the usual static assets, one filename immediately caught their eye:
assets/assets/.....js
This is a path inside the bucket: two folders both called assets, then a file ending in .js, which marks it as JavaScript. The dots stand for parts of the name that are not reproduced here.
Whenever you see the word legacy, old, backup, or dev in a filename, pay attention. Developers often tighten security on their latest production builds, but old build artifacts left sitting in a storage bucket frequently contain mistakes from earlier versions. A "build" is the process of turning source code into the files a browser can run; a "build artifact" is the output of that process. "Production" means the live system real customers use.
Digging Into the Code
The researcher downloaded the JavaScript bundle to their terminal and decided to check if any environment variables had been baked into the client-side code during the build process. A "bundle" is many source files packed into one big file to save download time. "Client-side" means it runs on the visitor's own computer, in the browser, where anyone can read it. A "terminal" is the text window where you type commands instead of clicking.
If you have ever worked with React (specifically Create React App), you know that any environment variable prefixed with REACT_APP_ gets embedded directly into the final static JavaScript bundle at build time. React is a popular toolkit for building web interfaces; Create React App is a standard starter kit for React projects. "Prefixed" means the name starts with those characters. "Embedded at build time" means the value is copied into the file when it is built, so it is physically present in what the browser downloads.
If a developer accidentally puts a sensitive key in a .env file with that prefix, it goes straight to the public. A .env file is a small text file where developers keep settings and secrets for their own machine, normally not meant to be shared. The prefix is supposed to mark a value as safe to publish; the mistake is putting something private behind it.
The researcher ran a quick curl and grep one-liner to see what was hiding inside. curl is a command-line tool that fetches a web address and prints or saves what comes back. grep is a command-line tool that searches text for a pattern and prints the matching lines. A "one-liner" is several commands chained on one line.
curl -s "https:.....js" -o vidio_leaked.jsgrep -o 'REACT_APP_[A-Z_]*:"[^"]*"' vidio_leaked.js
Line by line:
curl -s "https:.....js" -o vidio_leaked.jsasks curl to download the file at that address. The-smeans silent, so it does not print progress noise. The-o vidio_leaked.jsmeans write the result into a local file with that name instead of showing it on screen.grep -o 'REACT_APP_[A-Z_]*:"[^"]*"' vidio_leaked.jssearches the downloaded file. The-omeans print only the matching part, not the whole line. The pattern in quotes describes what to look for: the literal textREACT_APP_, then any run of capital letters and underscores ([A-Z_]*), then a colon, then a double quote, then any characters that are not a double quote ([^"]*), then a closing double quote. In plain words: find every setting whose name starts withREACT_APP_and show its name and value.
Seconds later, the terminal printed exactly what the researcher was hoping for:
REACT_APP_FLAVOUR:"production"REACT_APP_SENTRY_DSN:"https://7....."REACT_APP_HMAC_SECRET:"V1..."REACT_APP_MUX_API_KEY:"v..."REACT_APP_SK_ID:"...."REACT_APP_SK:"KS...."REACT_APP_RELEASE_VERSION:""REACT_APP_SHORT_HASH:""
Each entry is a name, a colon, and a value in quotes. REACT_APP_FLAVOUR says production, meaning the build was marked as a production build. REACT_APP_SENTRY_DSN is an address used to send crash reports to a service called Sentry. REACT_APP_HMAC_SECRET is a signing key; an HMAC is a way of proving a message was not altered, using a shared secret. REACT_APP_MUX_API_KEY is a key for Mux, a video service. REACT_APP_SK_ID and REACT_APP_SK look like a key identifier and a secret key. The last two are empty.
Seeing REACT_APP_HMAC_SECRET and a 32-byte Base64 string inside REACT_APP_SK (Secret Key) in a production build felt like hitting gold. "Base64" is a way of writing arbitrary data using only letters, digits and a couple of symbols, so it can travel safely in text; a "32-byte" value is 32 units of raw data, which Base64 turns into a longer string of characters.
Writing the PoC and Submitting the Report
A "PoC", proof of concept, is a small demonstration that shows a problem is real, without doing any harm. To make life as easy as possible for the triage team, the researcher wrote a clean Node.js script that automatically fetched the JS bundle and parsed out the exposed keys using Regex. "Triage" is the first review a company does on a report, deciding whether it is real and how serious. Node.js is a program that runs JavaScript outside the browser, on your computer. "Parsed" means picked apart to extract the useful pieces. A "regex", regular expression, is a pattern language for describing text to search for.
const https = require('https');
This line loads Node's built-in https module, which lets the script make secure web requests, and stores it in a constant called https.
const VULNERABLE_URL = 'https:
This line defines a constant holding the address of the file to fetch. The address is cut off in the report.
https.get(VULNERABLE_URL, (res) => { let data = ''; res.on('data', chunk => data += chunk); res.on('end', () => { const secrets = { 'HMAC_SECRET': data.match(/REACT_APP_HMAC_SECRET:"([^"]+)"/), 'SK (Secret Key)': data.match(/REACT_APP_SK:"([^"]+)"/), 'SK_ID': data.match(/REACT_APP_SK_ID:"([^"]+)"/), 'MUX_API_KEY': data.match(/REACT_APP_MUX_API_KEY:"([^"]+)"/), 'SENTRY_DSN': data.match(/REACT_APP_SENTRY_DSN:"([^"]+)"/) };
Line by line:
https.get(VULNERABLE_URL, (res) => {starts a download of that address. When the server begins answering, the function after the comma runs, withresstanding for the response.let data = '';creates an empty text box to collect the file contents.res.on('data', chunk => data += chunk);says: every time a piece of the file arrives, append it todata. Files arrive in pieces, not all at once.res.on('end', () => {says: when the download is finished, run the following.const secrets = {starts a list of named patterns to look for.- Each entry, such as
'HMAC_SECRET': data.match(/REACT_APP_HMAC_SECRET:"([^"]+)"/),, searches the downloaded text for that setting name followed by a quoted value, and keeps the value. The parentheses in the regex mark the part to capture, and[^"]+means one or more characters that are not a double quote. };closes the list.
for (const [name, match] of Object.entries(secrets)) { if (match) { console.log(`${name}: ${match[1]}`); } } });}).on('error', console.error);
Line by line:
for (const [name, match] of Object.entries(secrets)) {goes through the list one entry at a time, withnamebeing the label andmatchbeing the result of the search.if (match) {checks that something was actually found.console.log(${name}: ${match[1]});prints the label and the captured value.match[1]means the first captured group, the text inside the quotes.- The closing braces end the check, the loop and the download handler.
}).on('error', console.error);attaches a handler so that if the download fails, the error is printed instead of silently ignored.
The script only demonstrates exposure; it does not attempt to use any of the keys. That distinction matters: showing that a key is visible is harmless, while trying the key against a live system could break rules.
In the report, the researcher rated the severity as High. The reasoning at the time was that if the HMAC_SECRET and SK were used to sign API requests or tokens without strict server-side checks, an attacker could potentially forge signatures or manipulate requests. An "API" is the doorway a program uses to talk to a server, for example to fetch your video list. A "token" is a short piece of text that proves who you are, like a wristband at an event. "Signing" a request means attaching proof that it came from someone holding the secret. "Server-side checks" are checks the server performs itself, which a visitor cannot bypass by editing what their browser sends.
On February 8, 2026, the researcher hit send on the email to [redacted] and waited.
Expectation vs. Reality: The Triage
Two days later, on February 10, the Vidio Security team replied confirming they were validating the report.
Then, on February 19, the final verdict arrived. It taught a large lesson about how real production architectures work. An "architecture" here means how the company's systems are put together.
- It was an unused legacy artifact. The JS bundle came from an older build that was no longer used in their active deployment. "Deployment" means the version actually running and serving customers. In their current production system, those variables were no longer exposed the same way.
- Defence in depth on the server side. Even with those keys exposed, Vidio had additional server-side validation layers. "Defence in depth" means several independent protections, so that one failure does not sink the ship. The keys themselves were considered public or semi-public client identifiers by design, like the Mux analytics key and the Sentry DSN, and could not be used on their own to compromise user data or take over accounts. A "client identifier" is a label that identifies an app to a service, not a password.
At that point in the email, the researcher thought, "Well, there goes my bounty. It is going to be closed as Informative with a pat on the back."
Then they read the last two paragraphs:
"However, this report still helped us identify legacy files that had not yet been cleaned up in our storage bucket. We are currently cleaning up old assets and rotating the keys as a preventive measure.
Referring to our reward policy, we categorize this report as Informational but Useful, and as a token of appreciation for your responsible disclosure, we would like to award you a bounty of Rp ….."
"Rotating the keys" means replacing old keys with new ones, so the old ones stop working. "Responsible disclosure" means telling the company privately and giving them time to fix it before anyone else learns of it.
Key Takeaways for Fellow Beginner Hunters
Getting that first reward was not just about the money; it was proof that the methodology works. "Methodology" means the repeatable way of working. Looking back, here are three things the researcher learned:
- Do not sleep on legacy files: Cloud buckets often act like digital attics. Old deployments get left behind all the time. Even if a bug does not affect the latest v3.0 app, finding leftover v1.0 files can help a company clean up their attack surface. "Attack surface" is everything an outsider can see and touch.
- Client-side keys are not instantly critical: Just because a variable is named
SECRETinside a.jsfile does not automatically mean it gives you keys to the kingdom. Always try to verify what a key actually does, though if you are not sure and want to stay safe within scope rules, reporting it cleanly as a potential exposure is still the right call. "Scope" is the set of systems a programme allows you to test. - Write a clean, respectful report: Structuring the report clearly, providing 3 different reproduction methods (
Browser,curl, andBucket Listing) plus a ready-to-run Node.js script made the triage team's job effortless and contributed to them rewarding an "Informational" finding.
A large shoutout to the Vidio Security Team for the fast response, transparent explanation, and for running a beginner-friendly bug bounty programme that rewards hunters even for hygiene and defence-in-depth findings. "Hygiene" here means basic housekeeping, such as removing files nobody uses.
Glossary
- API: the doorway a program uses to talk to a server, for example to fetch your video list.
- Attack surface: everything an outsider can see and touch on a company's systems.
- Base64: a way of writing arbitrary data using only letters, digits and a couple of symbols, so it can travel safely in text.
- Bounty: the payment a company gives for a valid security report.
- Bucket: a folder in cloud storage where a business keeps files.
- Bucket listing: a storage setting that makes the server answer with a list of every file it holds.
- Bug bounty: a programme where a company pays people who report security problems privately.
- Build: the process of turning source code into the files a browser can run.
- Build artifact: the output of a build, such as a JavaScript bundle.
- Bundle: many source files packed into one big file to save download time.
- Client identifier: a label that identifies an app to a service, not a password.
- Client-side: code that runs on the visitor's own computer, in the browser, where anyone can read it.
- Cloud storage: files kept on someone else's servers, reachable over the internet.
- Create React App: a standard starter kit for building React projects.
- curl: a command-line tool that fetches a web address and prints or saves what comes back.
- Defence in depth: several independent protections, so that one failure does not sink the ship.
- Deployment: the version of a system actually running and serving customers.
- Duplicate: a report of a problem someone else already reported.
- Environment variables: settings a program reads when it starts, such as which server to talk to or which key to use.
- False positive: a finding that looks like a problem but is not.
- grep: a command-line tool that searches text for a pattern and prints the matching lines.
- Hardcoded: a value written directly into a file by hand, rather than fetched from somewhere safe at run time.
- HMAC: a way of proving a message was not altered, using a shared secret.
- Hygiene: basic housekeeping, such as removing files nobody uses.
- Informational: the lowest severity label, meaning worth knowing but not dangerous.
- JavaScript: the programming language web pages run inside your browser.
- Methodology: the repeatable way of working through a security test.
- Node.js: a program that runs JavaScript outside the browser, on your computer.
- One-liner: several commands chained on one line.
- Parsed: picked apart to extract the useful pieces.
- PoC (proof of concept): a small demonstration that shows a problem is real, without doing any harm.
- Prefix: the characters a name starts with.
- Production: the live system real customers use.
- Recon (reconnaissance): the looking-around phase of security testing, working out what a company has on the internet.
- Regex (regular expression): a pattern language for describing text to search for.
- Remote code execution (RCE): running your own commands on someone else's computer.
- Responsible disclosure: telling a company privately and giving them time to fix a problem before anyone else learns of it.
- Rotating keys: replacing old keys with new ones so the old ones stop working.
- Scope: the set of systems a programme allows you to test.
- Server-side checks: checks the server performs itself, which a visitor cannot bypass by editing what their browser sends.
- Severity: how serious a problem is judged to be.
- Signing: attaching proof to a request that it came from someone holding the secret.
- Static assets: files that do not change per visitor, such as pictures, fonts and code bundles.
- Subdomain: a prefix on a domain name, like a side entrance to the main building.
- Terminal: the text window where you type commands instead of clicking.
- Token: a short piece of text that proves who you are, like a wristband at an event.
- Triage: the first review a company does on a report, deciding whether it is real and how serious.
- XML: a text format for structured data, made of tags in angle brackets.
.envfile: a small text file where developers keep settings and secrets for their own machine, normally not meant to be shared.