Google API key leaks and security misconfiguration leads Open Redirect Vulnerability
A Google API key and a URL-shortening endpoint were exposed in a public JavaScript file, and the shortening service used a weak regex rule that could be bypassed. An attacker could create short links on the legitimate clario.co domain that redirect victims to any website or path.
- Triaged in 24 days
- Fixed in 2 months
- Paid in 24 days
- Disclosed after 3 months
Summary:
Hello, when i search your targets and javascript files I found an googleapikey leaks in url = https://account.clario.co/js/main.044af6485f6b0cd90809.js. Part of the leak down below;
'https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=AIzaSyAw-SpLHVTIP3IFEIkckCuEmIhnUrY9OrQ';

After that I do some research about that API key. I found how to use. This API shortening urls. API looks for key, company and regex rule for shortening urls. Ref Link1 => https://support.google.com/firebase/answer/9021429 Ref Link2 =>https://firebase.google.com/docs/dynamic-links/rest
While I was trying to test regex I was figured out i can short urls that redirect users whatever I want because of wrong regex leads security misconfiguration. Also I found urls shortening from https://lnk.clario.co/?link=[URLHERE]. I found that endpoint from same javascript file.
You can type anydomain and any urls only thing you need to do is add /clario.co/ path to your url.
Here is an example PoC video;
You can redirect any website and any path to victims with that dynamic url.
Steps To Reproduce:
[add details for how we can reproduce the issue]
- Get API key from javascript file.
- Find endpoint for shortening url from javascript file.
- Use postman or another tool for creating short url.
- Send url to victims. After that its up to your imagination :).
Supporting Material/References:
[list any additional material (e.g. screenshots, logs, etc.)]
Impact
Shortened link looks legit because its coming from clairo.co when we are looks from the victims perspective. Because of this victims can click the link easily and redirect to malicious websites.
Context
Clario's customer-facing account application lives at account.clario.co. The report concerns two things found in the JavaScript that this application ships: a Google API key embedded in a bundle, and a URL-shortening endpoint on lnk.clario.co that the same bundle references.
The API key belongs to the Firebase Dynamic Links REST API, which creates short links. According to the researcher's reading of Google's documentation, the shortLinks endpoint takes a key, a company (the Dynamic Link domain) and a regex rule that governs which URLs may be shortened. The intended behaviour is that only URLs matching the configured rule can be turned into short links. The bug is that the rule was too permissive, so the shortener would wrap arbitrary destinations.
Setup
The researcher worked from the public JavaScript bundle served by the account application and from Google's public documentation for Firebase Dynamic Links. No account, role or special access is described. The tools mentioned are a browser or HTTP client to read the bundle, and Postman (or any equivalent) to call the API. The researcher worked from the public bundle and Google's documentation, using Postman or an equivalent tool to call the API.
Finding it
While reviewing the target's JavaScript files, the researcher found a Google API key in the main bundle:
https://account.clario.co/js/main.044af6485f6b0cd90809.js
Inside that file, the key appears in a call to the Firebase Dynamic Links shortLinks endpoint:
'https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=[redacted]';

The same bundle also revealed the shortening endpoint used by the site itself:
https://lnk.clario.co/?link=[URLHERE]
Two things made this worth pursuing. First, a client-side API key is exposed to anyone who downloads the bundle. Second, the shortener is reachable directly through a query parameter, so the researcher could test what the backend would accept without going through the application's UI.
Exploitation
Step 1: Read the API key and the endpoint from the bundle
The key and the lnk.clario.co endpoint both come from main.044af6485f6b0cd90809.js. The key is passed as the key query parameter to https://firebasedynamiclinks.googleapis.com/v1/shortLinks, and the endpoint is called with a link parameter holding the destination URL.
Step 2: Work out how the API shortens URLs
The researcher studied Google's documentation for Firebase Dynamic Links (the support article on the shortening rule and the REST reference for Dynamic Links). From that, the API needs the key, the company (the Dynamic Link domain) and a regex rule that decides which URLs may be shortened.
Step 3: Test the regex rule
While testing the regex, the researcher found that the rule could be satisfied by URLs pointing anywhere, not just to Clario destinations. The researcher describes that adding the /clario.co/ path to your URL is enough. With that path present, the shortener would accept the URL and produce a short link.
Step 4: Create the short link and deliver it
The reproduction steps call for using Postman or a similar tool to create the short link and sending it to victims. The PoC video shows the flow:
Because the short link is on the clario.co domain, it looks legitimate from the victim's point of view, and clicking it redirects to whatever destination the attacker chose.
Root cause
The mistake is in the shortening rule configured for the Dynamic Links project: the regex that is supposed to restrict which URLs can be shortened is too permissive. The researcher's description is that adding the /clario.co/ path to an arbitrary URL is enough to pass the check, so the rule matches on a substring rather than constraining the destination to Clario's own hosts and paths. The API key being present in a public JavaScript bundle is what makes the endpoint reachable in the first place; the permissive rule is what turns that into an open redirect. The report does not describe any server-side validation on lnk.clario.co itself that would have caught the bad destination.
Impact
An attacker can create short links on the clario.co domain that redirect to any website and any path. From the victim's perspective the link looks like it belongs to Clario, which makes it easier to get clicks, and the destination can be a malicious site. The report describes this as an open redirect. The impact depends on a victim trusting the clario.co short domain and following the link; the report does not describe any further consequence beyond the redirect itself.
Fix
The fix that follows from the root cause is to tighten the shortening regex so that only Clario-owned destinations can be shortened, rather than accepting any URL that contains /clario.co/. Restricting the API key so it cannot be used to create arbitrary short links, and validating the link parameter on lnk.clario.co against an allowlist, would address the same issue from the other side.
Variants to test
- Other Firebase Dynamic Links projects. Look for
firebasedynamiclinks.googleapis.com/v1/shortLinks?key=in JavaScript bundles. A positive result is a key that returns a short link for a destination outside the intended domain. - Regex bypasses on the shortening rule. Try destinations that contain the expected path as a substring, for example a host you control with
/clario.co/in the path. A positive result is a short link that resolves to your host. - Direct shortener endpoints. Test parameters such as
?link=on the short domain with external URLs. A positive result is a redirect to a domain the application does not own. - Other client-side keys in the same bundle. Search for other API keys and endpoints in the same JavaScript file and test whether they enforce their own restrictions.
Hunting notes
This kind of bug tends to hide in two places: JavaScript bundles that embed third-party API keys, and short-link or redirect endpoints that take the destination as a query parameter. During recon, grep the bundles for googleapis.com, key=, and short-domain hostnames, then check whether the key is restricted and whether the shortening rule can be satisfied by a URL you control. The researcher included a PoC video of the flow, which makes the open redirect concrete.
Steps to reproduce (as given in the report)
- Get the API key from the JavaScript file.
- Find the endpoint for shortening URLs from the JavaScript file.
- Use Postman or another tool to create the short URL.
- Send the URL to victims.
What happened, in plain words
Clario runs a website where customers manage their account, at account.clario.co. Like most modern websites, that site loads a set of JavaScript files into your browser. JavaScript is the programming language that makes web pages interactive, and a bundle is simply one large file that packs lots of that code together. Anyone can download these files, because your browser has to download them to run the site.
While reading those files, the researcher found two useful things inside them. The first was a Google API key. The second was the address of a link-shortening service that Clario uses, on lnk.clario.co.
An API is a way for one piece of software to talk to another over the internet, a bit like a service counter: you hand over a request in a fixed format and get an answer back. An API key is a password-like string that identifies who is making the request. Google's Firebase Dynamic Links API is a service that turns long web addresses into short ones. A short link is handy because it is easy to share, and it also hides where it really points.
When you ask that API to shorten a link, it checks the destination against a rule, written as a regex. A regex (regular expression) is a pattern used to test text, for example "does this address contain these characters?". The rule is a regex that decides which addresses can be shortened. In this case the rule was too loose: any address that merely contained the text /clario.co/ somewhere in it was accepted. That let the researcher create short links on the clario.co domain that send people to any website at all. This kind of flaw is called an open redirect: a trusted site's link that will forward a visitor to a destination the site owner did not intend.
Finding the key and the endpoint
The researcher started by looking through the JavaScript files the account site serves. The main bundle is:
https://account.clario.co/js/main.044af6485f6b0cd90809.js
This is just a web address for one file. Opening it in a browser, or fetching it with any tool that can make web requests, gives you the full source code of that file, because the browser needs it to run the page. Nothing secret is required to read it.
Inside that file, the key appears in a call to Google's short-links service:
'https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=[redacted]';
Read this piece by piece:
https://firebasedynamiclinks.googleapis.comis Google's server for Firebase Dynamic Links./v1/shortLinksis the specific operation on that server that creates a short link.?key=starts the part of the address that carries extra information, called query parameters. Everything after the?is a list of name and value pairs.[redacted]is the value of thekeyparameter, the API key itself.
Because this string sits in a file that every visitor downloads, the key is effectively public. That is the first half of the problem.

The screenshot shows the key as it appears in the JavaScript file.
The same bundle also contained the address of the shortener that Clario's own site uses:
https://lnk.clario.co/?link=[URLHERE]
Here lnk.clario.co is Clario's short-link domain, and link is a query parameter whose value is the destination address. [URLHERE] is a placeholder standing in for whatever address you supply. The important point is that the destination is passed in the address bar itself, so anyone can try different values without going through the site's normal screens.
Working out how the API behaves
Before sending anything, the researcher read Google's public documentation for Firebase Dynamic Links: the support article on the shortening rule and the REST reference for the service. Documentation is the official description of how a service is meant to be used, and reading it first saves guesswork.
From that reading, the shortLinks operation needs three things: the key, a company value (the Dynamic Link domain, meaning the domain the short link will live on), and a regex rule that decides which destination addresses are allowed to be shortened. The idea is that the rule acts as a filter: only addresses matching the pattern get a short link.
Testing the rule
While experimenting with the regex, the researcher discovered that the filter could be satisfied by addresses pointing anywhere, not only to Clario pages. The report describes that adding the /clario.co/ path to your address is enough. A path is the part of a web address after the domain name, for example the /clario.co/ in https://example.com/clario.co/page. If that text appears anywhere in the address, the shortener accepts it and produces a short link.
Think of it like a bouncer who is told to let in anyone wearing a Clario badge, but who only checks whether the words "Clario" appear somewhere on the person's clothing. Anyone can print those words on a T-shirt.
Creating the short link and sending it
The reproduction steps call for using Postman or an equivalent tool to create the short link and sending it to victims. The proof-of-concept video shows the flow:
A proof of concept (PoC) is a small demonstration that a flaw is real and can be triggered, rather than just suspected. The video is the proof of concept for the flow.
Because the short link sits on the clario.co domain, it looks like it belongs to Clario. A visitor has no easy way to see where it will send them before clicking, so they are more likely to trust it and follow it.
Why it works
The mistake is in the shortening rule configured for the Dynamic Links project. The regex that should restrict which addresses can be shortened is too permissive. According to the researcher, adding the /clario.co/ path to any address is enough to pass the check, which means the rule looks for that text somewhere in the address instead of requiring the destination to be one of Clario's own hosts and paths.
The exposed API key is what makes the service reachable in the first place: without it, the researcher could not call the shortLinks operation. The loose rule is what turns that access into an open redirect. The report does not describe any check on lnk.clario.co itself that would have rejected the bad destination.
What an attacker could do
An attacker can create short links on the clario.co domain that redirect to any website and any path. From the victim's point of view the link looks like it comes from Clario, which makes clicking it more likely, and the destination can be a malicious site. The report describes this as an open redirect. The impact depends on a victim trusting the clario.co short domain and following the link; the report does not describe any consequence beyond the redirect itself.
How to fix it
The fix that follows from the cause is to tighten the shortening regex so that only Clario-owned destinations can be shortened, instead of accepting any address that contains /clario.co/. Restricting the API key so it cannot be used to create arbitrary short links, and checking the link parameter on lnk.clario.co against a list of allowed destinations, would close the same gap from the other side.
Related things worth testing
- Other Firebase Dynamic Links projects. Search JavaScript bundles for
firebasedynamiclinks.googleapis.com/v1/shortLinks?key=. A positive result is a key that returns a short link for a destination outside the intended domain. - Regex bypasses on the shortening rule. Try destinations that contain the expected path as a substring, for example a host you control with
/clario.co/in the path. A positive result is a short link that resolves to your host. - Direct shortener endpoints. Try parameters such as
?link=on the short domain with external addresses. A positive result is a redirect to a domain the application does not own. - Other client-side keys in the same bundle. Look for other API keys and endpoints in the same JavaScript file and test whether they enforce their own restrictions.
Where to look when hunting
This kind of bug tends to hide in two places: JavaScript bundles that embed third-party API keys, and short-link or redirect endpoints that take the destination as a query parameter. During reconnaissance (the early stage of looking around a target), search the bundles for googleapis.com, key=, and short-domain hostnames, then check whether the key is restricted and whether the shortening rule can be satisfied by an address you control. The researcher included a PoC video of the flow, which makes the open redirect concrete.
Steps to reproduce (as given in the report)
- Get the API key from the JavaScript file.
- Find the endpoint for shortening URLs from the JavaScript file.
- Use Postman or another tool to create the short URL.
- Send the URL to victims.
Glossary
- API: a fixed way for one program to ask another program, over the internet, to do something and return a result.
- API key: a string that identifies who is calling an API, working like a password for the request.
- Bundle: a single JavaScript file that packs together much of a website's code, downloaded by every visitor.
- Company (Dynamic Link domain): in Firebase Dynamic Links, the domain the short link will live on.
- Dynamic Links: Google's Firebase service for creating short links that can carry a destination address.
- Endpoint: a specific address on a server that accepts a particular kind of request.
- Firebase: Google's platform of backend services for apps, including Dynamic Links.
- Host: the domain-name part of a web address, such as
lnk.clario.co. - JavaScript: the programming language that runs in web browsers and makes pages interactive.
- Open redirect: a flaw where a trusted site's link will forward a visitor to a destination the site owner did not intend.
- Path: the part of a web address after the domain, such as
/clario.co/. - PoC (proof of concept): a small demonstration that a flaw is real and can be triggered.
- Postman: a program for building and sending API requests by hand.
- Query parameter: a name and value pair after the
?in a web address, used to pass extra information. - Reconnaissance: the early stage of exploring a target to find what it exposes.
- Regex (regular expression): a pattern used to test whether text contains certain characters or follows a certain shape.
- REST reference: official documentation describing the operations an API offers.
- Short link: a brief web address that stands in for a longer one and forwards visitors to it.
- Shortener: a service that creates short links.
- Vulnerability: a weakness in software that someone can use to make it behave in a way its owner did not intend.