From an Innocent api-key to PII data
A third-party loyalty API key and GUID were exposed in a script tag on a customer-facing website. An attacker could use these credentials to query the loyalty API and retrieve customer PII.
Published on crypt0g30rgy.github.io
It was on a thursday of february 2023, i had just gotten of driving and i was feeling tired, at the same time i was feeling meh since i had not done any good hacking that week, just doing random stuffs. so i took out my laptop sat on the coach and hopped on intigriti and started looking around on the recently update…
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
This is a write-up of a bug bounty finding on a program the author refers to as jij0. The asset in scope was a customer-facing web shop at https://customers.jij0.me/, which offers login, signup and a shop front. The interesting part was not the shop itself but a block of configuration data embedded in the page source, and the third-party loyalty API those values unlocked.
The loyalty API belongs to Yotpo. According to the report, the keys found in the page were not just identifiers: they were the authentication keys for the loyalty API, and that API exposes an endpoint that returns customer records.
Setup
The researcher was working from a laptop with a browser and Burp Suite, browsing the program's scope on Intigriti after it had been updated. No account on the target is described as necessary for the finding: the configuration block was visible to anyone who loaded the page and viewed its source. The only external material used was Yotpo's public developer documentation, specifically the Loyalty API reference and the "fetch all recently updated customers" endpoint page.
Finding it
The researcher enumerated subdomains and, because the list was short, visited them one by one. https://customers.jij0.me/ looked ordinary: login, signup, a web shop. The next step was the usual view-source: review of the JavaScript for hardcoded credentials, tokens or API keys. That review turned up a configuration object inside a script tag:
<script> REDACTED... apiurl":"https://customers.jij0.me/v2","env":"prod","YOTPO-MERCHANT-ID":"XXXXX","YOTPO-API-KEY":"API_KEY_HERE","YOTPO-GUID":"GUID_HERE" ...REDACTED </script>
The values initially looked uninteresting, and a search for public exploitation techniques against Yotpo API keys returned nothing. The turning point was remembering that vendors publish developer documentation. Reading the Yotpo Loyalty API docs showed that the keys in the page were the loyalty API keys and, more importantly, that the same keys acted as the authentication keys for that API. Further reading of the customer endpoint documentation showed that customer data could be queried with them.
The researcher's own takeaway, quoted from the report: just because something has not been exploited and documented publicly does not mean it is not vulnerable; everything is vulnerable unless proven otherwise.
Exploitation
Step 1: Read the configuration from the page source
- Visit
https://customers.jij0.me/. - Open the page source, by right-clicking or with
ctrl + u(cmd + uon macOS). - Scroll to the bottom to find the script block shown above, containing
YOTPO-MERCHANT-ID,YOTPO-API-KEYandYOTPO-GUID.
The YOTPO-API-KEY and YOTPO-GUID values are the two secrets needed for the next step. In the report they are replaced with API_KEY_HERE and GUID_HERE.
Step 2: Confirm the endpoint rejects an unauthenticated request
Visit https://loyalty.yotpo.com/api/v2/customers/recent?per_page=100 with Burp intercepting, send the request to Repeater and send it. The response is a 401 error.
Step 3: Add the leaked keys as headers
Alter the request to carry the two values from the page source:
GET /api/v2/customers/recent?per_page=100 HTTP/2
Host: loyalty.yotpo.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0
Accept: application/json
X-Guid: GUID_HERE
X-Api-Key: API_KEY_HERE
X-Guid carries the merchant GUID and X-Api-Key carries the API key, both taken verbatim from the script block. Sending this request returned customer data, which the researcher describes as PII. Testing stopped at that point.
Step 4: Reproduce with curl
The report includes a one-line reproduction outside Burp:
curl -i -s -k -X $'GET' \
-H $'Host: loyalty.yotpo.com' -H $'Accept: application/json' -H $'X-Guid: GUID_HERE' -H $'X-Api-Key: API_KEY_HERE' \
$'https://loyalty.yotpo.com/api/v2/customers/recent?per_page=100'
-i includes the response headers, -s silences the progress meter and -k skips TLS verification. The two custom headers are the same pair as in the Burp request.
Outcome
The report was submitted to the program on Intigriti and triaged as critical. A few days later the researcher received a €200 bonus.

Root cause
The design mistake is that a secret capable of authenticating to a data-returning API was shipped to every visitor of the shop in the page's HTML. Anyone who viewed the source could read it, with no account and no interaction with the shop's own features. The Yotpo loyalty API documentation showed the keys were the authentication keys, and customer data could be queried with them.
Impact
An unauthenticated visitor to the public shop page could extract the merchant's loyalty API key and GUID and use them to fetch recently updated customer records from the loyalty API, at up to 100 per page. The data returned is described as PII. The researcher stopped testing after the first successful response, so the full extent of what the key allows is not documented in the report. The exposure depends on the key remaining valid and on the endpoint continuing to accept it as the sole authentication factor.
Fix
The report does not describe any remediation applied by the program. The change that addresses the root cause is to stop shipping the loyalty API key and GUID in client-side HTML, and to keep calls that need them on a server-side component that holds the secret and proxies only the data the shop legitimately needs.
Variants to test
- Other script-tag configuration blocks. On any shop front, view the source and search for vendor names,
api-key,apiKey,merchant,guidandenv. A positive result is a key pair that a vendor's public documentation describes as authentication material. - Vendor documentation as an exploitation guide. For each third-party key found, locate the vendor's developer docs and check whether the key is an auth key rather than a public identifier. A positive result is a documented endpoint that returns data when the key is supplied in a header or query parameter.
- Unauthenticated baseline first. Request the vendor endpoint without the key and confirm the
401, then add the leaked headers. A change from401to a response with records in the body confirms the key grants access. - Pagination parameters. Where the endpoint accepts something like
per_page, vary it and page through results to see how much data a single key exposes. A positive result is a larger result set than the shop's own UI ever requests. - Environment values. Configuration blocks often carry an
envfield. Check whether keys labelled for one environment are accepted by another, which would widen the impact beyond the production shop.
What happened, in plain words
A security researcher was browsing a bug bounty platform called Intigriti, where companies publish the rules for testing their systems and pay for reports of security problems. One company, which the researcher calls jij0 in the write-up, had just updated the list of things testers are allowed to look at (the "scope"). The researcher looked at one of the company's websites, a normal online shop where customers can log in, sign up and buy things.
While looking at the shop's page source (the raw code a browser receives before it draws the page), the researcher found a small block of settings that included two secret-looking values: an API key and a GUID. These turned out to belong to a third-party service called Yotpo, which runs loyalty programmes for shops. The researcher read Yotpo's public developer documentation and discovered that those same values were not just labels: they were the credentials needed to log in to Yotpo's loyalty API, and that API has an endpoint that returns customer records.
By sending a request to that endpoint with the two leaked values attached, the researcher received customer data, which the report describes as PII (personally identifiable information, meaning data that can identify a real person). The researcher stopped testing at that point, wrote a report, and submitted it to the program on Intigriti. The report was triaged as critical, and a few days later the researcher received a €200 bonus.
The rest of this article walks through the same steps slowly, explaining every term along the way, so that someone who has never done security testing can follow what happened and why each step was taken.
The pieces involved
Before the steps, here are the main pieces of the story, explained from scratch.
The shop
The target was a customer-facing web shop at https://customers.jij0.me/. It offered login, signup and a shop front. Nothing about the shop's own features was the problem. The problem was a block of configuration data that the shop sent to every visitor inside its page source.
What an API is
An API (application programming interface) is a way for one piece of software to talk to another. A useful everyday comparison is a restaurant. You do not walk into the kitchen and cook; you tell the waiter what you want, and the waiter brings it back from the kitchen. The API is the waiter: you send a structured request, and it sends back a structured answer. Websites use APIs constantly, for example to fetch your order history or your loyalty points without reloading the whole page.
What an API key and a GUID are
An API key is a long string of characters that acts like a password for software. When one system calls another, it presents the key so the other side knows the caller is allowed in. A GUID (globally unique identifier) is a long string that identifies something specific, in this case the merchant's account at Yotpo. Think of the GUID as your account number and the API key as the password that goes with it. You normally need both to be let in.
What Yotpo is
Yotpo is a third-party company that provides loyalty and marketing features to online shops. Shops embed Yotpo's code in their pages so that customers can collect points, leave reviews and so on. Yotpo also runs a public API, documented on its website, that shops and their developers use to read and write loyalty data.
What "view-source" means
Every web page your browser shows is built from text: HTML for the structure, JavaScript for the behaviour, and often blocks of settings. "View source" is a browser feature that shows you that raw text instead of the rendered page. You can open it by right-clicking and choosing the view-source option, or with the keyboard shortcut ctrl + u on Windows and Linux, or cmd + u on macOS. It is a normal, harmless thing to do, and it is one of the first places a tester looks, because anything sent to the browser can be read by anyone.
What Burp Suite is
Burp Suite is a tool that sits between your browser and a website and lets you see and edit the requests your browser sends and the responses it gets back. Two parts of it matter here. "Intercept" pauses a request so you can look at it before it goes out. "Repeater" lets you take a request, change it, and send it again as many times as you like, watching what comes back each time. It is like being able to rewrite a letter after you have posted it and see how the recipient answers the new version.
Finding it
The researcher was working from a laptop with a browser and Burp Suite, browsing the program's scope on Intigriti after it had been updated. No account on the target is described as necessary for the finding: the configuration block was visible to anyone who loaded the page and viewed its source. The only external material used was Yotpo's public developer documentation, specifically the Loyalty API reference and the "fetch all recently updated customers" endpoint page.
The researcher enumerated subdomains, meaning looked for other names under the company's main domain (for example shop.jij0.me or customers.jij0.me), and because the list was short, visited them one by one. https://customers.jij0.me/ looked ordinary: login, signup, a web shop. The next step was the usual view-source: review of the JavaScript for hardcoded credentials, tokens or API keys. That review turned up a configuration object inside a script tag:
<script> REDACTED... apiurl":"https://customers.jij0.me/v2","env":"prod","YOTPO-MERCHANT-ID":"XXXXX","YOTPO-API-KEY":"API_KEY_HERE","YOTPO-GUID":"GUID_HERE" ...REDACTED </script>
Line by line, in plain words:
<script>and</script>mark the start and end of a block of code that the browser will run. Settings are often placed inside such a block so the page's JavaScript can read them.REDACTED...and...REDACTEDshow that the researcher removed parts of the block before publishing, so the article does not expose everything that was there."apiurl":"https://customers.jij0.me/v2"is the address the page's code uses to talk to its own back end. The/v2part is a version number in the address."env":"prod"says which environment this is. "prod" is short for production, the live system real customers use, as opposed to a test system."YOTPO-MERCHANT-ID":"XXXXX"is the shop's identifier at Yotpo. The real value is replaced withXXXXXin the article."YOTPO-API-KEY":"API_KEY_HERE"is the API key, replaced with the placeholderAPI_KEY_HERE."YOTPO-GUID":"GUID_HERE"is the GUID, replaced with the placeholderGUID_HERE.
The values initially looked uninteresting, and a search for public exploitation techniques against Yotpo API keys returned nothing. The turning point was remembering that vendors publish developer documentation. Reading the Yotpo Loyalty API docs showed that the keys in the page were the loyalty API keys and, more importantly, that the same keys acted as the authentication keys for that API. Further reading of the customer endpoint documentation showed that customer data could be queried with them.
The researcher's own takeaway, quoted from the report: just because something has not been exploited and documented publicly does not mean it is not vulnerable; everything is vulnerable unless proven otherwise.
Exploitation
Step 1: Read the configuration from the page source
- Visit
https://customers.jij0.me/. - Open the page source, by right-clicking or with
ctrl + u(cmd + uon macOS). - Scroll to the bottom to find the script block shown above, containing
YOTPO-MERCHANT-ID,YOTPO-API-KEYandYOTPO-GUID.
Why this step: anything a page sends to your browser can be read by you, so the page source is the first place to check whether secrets have been shipped to visitors. The YOTPO-API-KEY and YOTPO-GUID values are the two secrets needed for the next step. In the report they are replaced with API_KEY_HERE and GUID_HERE.
Step 2: Confirm the endpoint rejects an unauthenticated request
Visit https://loyalty.yotpo.com/api/v2/customers/recent?per_page=100 with Burp intercepting, send the request to Repeater and send it. The response is a 401 error.
Why this step: a 401 is the standard HTTP status code for "you are not authorised". Getting it first gives you a baseline. If the same request later succeeds once you add the keys, you know the keys are what made the difference, rather than the endpoint being open to everyone.
Step 3: Add the leaked keys as headers
Alter the request to carry the two values from the page source:
GET /api/v2/customers/recent?per_page=100 HTTP/2
Host: loyalty.yotpo.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0
Accept: application/json
X-Guid: GUID_HERE
X-Api-Key: API_KEY_HERE
Line by line, in plain words:
GET /api/v2/customers/recent?per_page=100 HTTP/2is the request line.GETmeans "give me something". The path/api/v2/customers/recentnames the endpoint that returns recently updated customers.?per_page=100is a parameter in the URL.HTTP/2is the version of the web protocol being used.Host: loyalty.yotpo.comtells the server which site the request is for. One server can host many sites, so this line picks the right one.User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0identifies the browser that supposedly made the request. Here it is the string a Firefox browser sends.Accept: application/jsonsays the caller expects the answer in JSON, a common text format for structured data.X-Guid: GUID_HEREis a custom header carrying the merchant GUID. Headers are extra labelled lines attached to a request, like the fields on an envelope.X-Api-Key: API_KEY_HEREis a custom header carrying the API key.
X-Guid carries the merchant GUID and X-Api-Key carries the API key, both taken verbatim from the script block. Sending this request returned customer data, which the researcher describes as PII. Testing stopped at that point.
Step 4: Reproduce with curl
The report includes a one-line reproduction outside Burp:
curl -i -s -k -X $'GET' \
-H $'Host: loyalty.yotpo.com' -H $'Accept: application/json' -H $'X-Guid: GUID_HERE' -H $'X-Api-Key: API_KEY_HERE' \
$'https://loyalty.yotpo.com/api/v2/customers/recent?per_page=100'
Line by line, in plain words:
curlis a command-line tool for sending web requests. It lets you repeat the same request without a browser.-iincludes the response headers in the output, so you can see the status code and other details, not just the body.-ssilences the progress meter, so the output is only the response.-kskips TLS verification. TLS is the encryption that makeshttpssecure;-ktells curl not to check the server's certificate.-X $'GET'sets the request method toGET.-H $'Host: loyalty.yotpo.com'sets theHostheader.-H $'Accept: application/json'sets theAcceptheader.-H $'X-Guid: GUID_HERE'and-H $'X-Api-Key: API_KEY_HERE'add the two custom headers with the leaked values.- The final line is the URL being requested, including the
per_page=100parameter.
The two custom headers are the same pair as in the Burp request.
Outcome
The report was submitted to the program on Intigriti and triaged as critical. A few days later the researcher received a €200 bonus.

Root cause
The design mistake is that a secret capable of authenticating to a data-returning API was shipped to every visitor of the shop in the page's HTML. Anyone who viewed the source could read it, with no account and no interaction with the shop's own features. The Yotpo loyalty API documentation showed the keys were the authentication keys, and customer data could be queried with them.
Impact
An unauthenticated visitor to the public shop page could extract the merchant's loyalty API key and GUID and use them to fetch recently updated customer records from the loyalty API, at up to 100 per page. The data returned is described as PII. The researcher stopped testing after the first successful response, so the full extent of what the key allows is not documented in the report. The exposure depends on the key remaining valid and on the endpoint continuing to accept it as the sole authentication factor.
Fix
The report does not describe any remediation applied by the program. The change that addresses the root cause is to stop shipping the loyalty API key and GUID in client-side HTML, and to keep calls that need them on a server-side component that holds the secret and proxies only the data the shop legitimately needs.
Variants to test
- Other script-tag configuration blocks. On any shop front, view the source and search for vendor names,
api-key,apiKey,merchant,guidandenv. A positive result is a key pair that a vendor's public documentation describes as authentication material. - Vendor documentation as an exploitation guide. For each third-party key found, locate the vendor's developer docs and check whether the key is an auth key rather than a public identifier. A positive result is a documented endpoint that returns data when the key is supplied in a header or query parameter.
- Unauthenticated baseline first. Request the vendor endpoint without the key and confirm the
401, then add the leaked headers. A change from401to a response with records in the body confirms the key grants access. - Pagination parameters. Where the endpoint accepts something like
per_page, vary it and page through results to see how much data a single key exposes. A positive result is a larger result set than the shop's own UI ever requests. - Environment values. Configuration blocks often carry an
envfield. Check whether keys labelled for one environment are accepted by another, which would widen the impact beyond the production shop.
Glossary
- API: a way for one piece of software to ask another for data or actions, like a waiter carrying your order to the kitchen and bringing back the result.
- API key: a long string that acts like a password for software, proving the caller is allowed to use an API.
- Authentication: the process of proving who you are, for example by presenting a key or password.
- Bug bounty program: a scheme where a company publishes rules and rewards for people who report security problems in its systems.
- Burp Suite: a tool that sits between your browser and a website so you can inspect, pause and edit requests and responses.
- Configuration block: a group of settings embedded in a page or script, often including addresses, environment names and keys.
- Critical: a severity label meaning the problem is serious and should be fixed urgently.
- curl: a command-line tool for sending web requests without a browser.
- Endpoint: a specific address on a server that performs a particular job, such as returning customer records.
- Enumeration: systematically listing things, such as subdomains, to find what exists.
- Environment (env): a label for which copy of a system you are using, such as production (live) or a test system.
- GUID: a long, globally unique identifier, here identifying the merchant's account at Yotpo.
- Header: an extra labelled line attached to a web request or response, like a field on an envelope.
- HTML: the text format that describes the structure of a web page.
- HTTP: the protocol browsers and servers use to exchange requests and responses.
- HTTP status code: a number in the response saying what happened, such as
401for not authorised or200for success. - Intigriti: a bug bounty platform where companies publish programs and researchers submit reports.
- Intercept: a Burp feature that pauses a request so you can inspect or change it before it is sent.
- JavaScript: the programming language browsers run to make pages interactive.
- JSON: a common text format for structured data, made of names and values.
- Loyalty API: Yotpo's API for reading and writing loyalty programme data, such as customer records.
- Parameter: a value added to a URL after a
?to adjust what the request asks for, such asper_page=100. - PII: personally identifiable information, data that can identify a real person.
- Production (prod): the live system that real customers use.
- Repeater: a Burp feature that lets you resend a request as many times as you like, with changes.
- Request: the message a browser or tool sends to a server asking for something.
- Response: the message a server sends back.
- Rotating a key: replacing a secret with a new one so the old one stops working.
- Scope: the list of systems a program allows researchers to test.
- Script tag: the HTML element that marks a block of code or settings for the browser to run.
- Subdomain: a name under a main domain, such as
customersincustomers.jij0.me. - TLS: the encryption that makes
httpssecure. - Triaged: reviewed by the program and given a severity rating.
- User-Agent: a header identifying the browser or tool that made a request.
- View-source: a browser feature that shows the raw text of a page instead of the rendered version.
- Yotpo: a third-party company that provides loyalty and marketing features to online shops.