First Bug Report, First Duplicate. What a Way to Start!
The application reflected an attacker-supplied Origin header in its CORS response and allowed credentials, suggesting a weak prefix-based origin check. The author suspected an attacker-controlled site could make authenticated cross-origin requests, but did not demonstrate end-to-end impact.
Published on medium.com
I found something suspicious, got excited, investigated it, and submitted my first bug bounty report.
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 an account of a first bug bounty submission against a web application the author was testing. The report does not name the program, the target domain, or the product. What it does describe is an authentication-related endpoint that the author came across while testing, and the behaviour of that endpoint's CORS response headers when the Origin request header was manipulated.
CORS (Cross-Origin Resource Sharing) is the mechanism by which a browser decides whether JavaScript running on one origin may read responses from another. The server signals its decision with response headers: Access-Control-Allow-Origin names the origin that is permitted, and Access-Control-Allow-Credentials: true tells the browser that cookies and other credentials may be attached to the cross-origin request and that the response may be read by the calling script. When a server reflects an arbitrary caller-supplied origin in Access-Control-Allow-Origin while also allowing credentials, any site on the internet can, in principle, make authenticated requests on behalf of a logged-in user and read the responses. That is the class of weakness the author was probing for.
Setup
The report gives very little about the environment. The tool used was Burp Suite, which the author used to intercept requests and modify the Origin header. No accounts, roles, versions or other preconditions are described. The only stated precondition is access to a web application exposing an endpoint that looked authentication-related and that returned CORS headers.
Finding it
While testing the application, the author came across what appeared to be an authentication-related endpoint. Experimenting with the Origin header in Burp Suite, the author changed its value and noticed that the server reflected the supplied origin back in the response.
That reflection alone is not necessarily a bug: a server may legitimately echo an allowed origin. What made it interesting was the combination with credentials. The author suspected that the application was validating origins with a weak startsWith() check rather than properly validating the hostname.
The reasoning was as follows. If the application trusted origins beginning with:
https://targetdomain.com
then an origin such as:
https://targetdomain.com.attacker.com
could pass a prefix check even though it belongs to an entirely different domain, because the string begins with the trusted value. A correct check would compare the parsed hostname exactly, or at least ensure that the trusted value is followed by a delimiter such as a slash or a port separator, not by an arbitrary label.
Exploitation
Step 1: Modify the Origin header
Using Burp Suite, the author modified the Origin header value and observed the server reflecting the supplied origin.
Step 2: Observe the reflected CORS headers
The response included:
Acess-Control-Allow-Origin: https://targetdomain.com.attacker.com
Access-Control-Allow-Credentials: true
The first header shows the supplied origin being echoed back, which is consistent with the prefix check the author suspected. The second header, Access-Control-Allow-Credentials: true, means the browser would be permitted to send credentials with the cross-origin request and to expose the response body to the calling script. Together they are the signature of a permissive CORS policy. (The header name is spelled Acess-Control-Allow-Origin in the report as reproduced above.)
Step 3: Explore subdomain takeover as an attack path
One of the possibilities the author explored was subdomain takeover: if an unclaimed subdomain of the target existed, it might provide another way to obtain an origin that the weak validation would trust, and from there to exploit the behaviour. The author could not find a takeover candidate, so this path did not lead anywhere.
Step 4: Submit the report
Despite the failed takeover exploration, the behaviour looked suspicious enough to investigate further, so the author submitted a report to HackerOne. The result was a single word: Duplicate. Someone had already reported the same issue.

The image sits at the point in the story where the duplicate notification arrived, illustrating the outcome of the submission.
Root cause
The author's assessment is that the application was using a weak startsWith() check to validate origins instead of properly validating the hostname. Under that design, any origin whose string begins with the trusted value, such as https://targetdomain.com.attacker.com, passes the check and is reflected in Access-Control-Allow-Origin. Because the response also carries Access-Control-Allow-Credentials: true, the browser treats the attacker's origin as trusted for credentialed cross-origin reads.
The report does not show the server-side code, so the startsWith() explanation is the author's inference from the observed reflection, not a confirmed reading of the implementation. The author suspected the origin check was a prefix comparison rather than a hostname comparison, which would not constrain the origin to the intended host.
Impact
The author is explicit that impact was not established. Seeing the origin reflected together with Access-Control-Allow-Credentials: true was exciting, but the author had not shown what an attacker could actually achieve. The question that mattered was not whether the server reflected an origin, but whether an attacker-controlled website could make an authenticated request and read sensitive information from the response. That end-to-end proof was never produced.
So the potential impact, under the conditions the author describes, is that a malicious site could issue credentialed cross-origin requests to the affected endpoint and read the responses on behalf of a logged-in user. Whether that yields anything sensitive depends on what the endpoint returns and what the credentials grant, which the report does not establish. The subdomain takeover route, which might have supplied a trusted origin through another means, was explored and abandoned when no candidate was found.
Fix
The weakness it describes would be addressed by validating the origin's hostname exactly rather than by prefix matching, so that https://targetdomain.com.attacker.com is not treated as https://targetdomain.com. Whether the program applied such a change is not stated.
Variants to test
These follow from the mechanism the author describes and are worth trying on other targets:
- Prefix confusion with a trailing label. Send
Origin: https://targetdomain.com.attacker.com. A positive result is that value echoed inAccess-Control-Allow-OriginalongsideAccess-Control-Allow-Credentials: true. - Prefix confusion with a different scheme or port. Try origins that begin with the trusted string but differ afterwards, for example a different port or a suffix that a naive comparison might ignore. A positive result is the same reflection with credentials allowed.
- Null origin. Send
Origin: nulland see whether it is reflected with credentials allowed. A positive result isAccess-Control-Allow-Origin: nullwithAccess-Control-Allow-Credentials: true. - Subdomain takeover as a trusted-origin source. Look for unclaimed subdomains of the target that the origin check would trust. A positive result is a takeover candidate whose hostname passes the application's origin validation.
- End-to-end proof. For any reflected origin with credentials, build a page on the attacker origin that makes a credentialed request to the endpoint and reads the response. A positive result is sensitive data from the victim's session appearing in the attacker page, which is the evidence the author identifies as missing here.
Hunting notes
This kind of bug tends to hide on endpoints that serve authenticated, data-bearing responses and that implement CORS by hand: API endpoints, authentication-related endpoints, and anything that returns per-user data. The signal during testing is a reflected Origin value in Access-Control-Allow-Origin, especially when it is paired with Access-Control-Allow-Credentials: true. Reflection of an arbitrary origin is the clue; the prefix trick is the way to test whether the allowlist is doing a string comparison rather than a hostname comparison.
The lesson the author draws is about impact. A reflected origin and a credentials flag are a lead, not a finding. The question to answer before submitting is whether an attacker-controlled website can make an authenticated request and read sensitive information from the response. Proving that end to end is what turns the observation into a report with demonstrated impact. The author also notes that time spent on one possible attack path, such as subdomain takeover, may be better spent understanding the actual impact of the CORS behaviour itself. In this case the result was a duplicate, so someone had already reported the same issue.
What happened, in plain words
Someone went looking for security bugs in a web application, found something that looked wrong, investigated it, and sent in their very first bug bounty report. A bug bounty is a scheme where companies pay people for reporting security problems to them instead of exploiting them. The person was already imagining how good it would feel to have that first report accepted.
Instead, the answer was one word: Duplicate. A duplicate means someone else had already reported the same problem, so this report did not count as a new discovery. Not the debut the author had planned. This is the story of how it went.
The idea behind the bug
Before the story makes sense, you need one piece of background: how a browser decides whether one website is allowed to read data from another.
When you use a website, your browser stores small pieces of information for it, such as a cookie. A cookie is a little note the site asks the browser to keep and to send back on every later request, and it is often what proves you are logged in. Think of it as a wristband you get at an event: you show it at the door and you are let in without showing your ticket again.
Websites are built from many separate pieces, and a page loaded from one address often needs to fetch data from another address. The browser is careful about this. By default, a script running on one site is not allowed to read the answer that comes back from a different site. This rule exists so that a page you visit cannot quietly read your private data from your bank or your email in another tab.
There is a controlled way to relax that rule, called CORS, short for Cross-Origin Resource Sharing. The server, meaning the computer that holds the data, can send back special labels in its answer, called headers, that tell the browser: "it is fine for this other site to read my answer". Two of those labels matter here:
Access-Control-Allow-Originnames the one site that is allowed to read the answer.Access-Control-Allow-Credentials: truesays that the browser may also attach the visitor's cookies to that request and let the calling script read the answer.
Put together, these two labels are a promise: "this named site may act as the logged-in user and read what comes back". That promise is only safe if the server names a site it truly trusts. If the server can be tricked into naming a site controlled by an attacker, the promise is handed to the wrong person.
Setting up
The report says very little about the environment. The tool used was Burp Suite, a program that sits between your browser and a website so you can look at the requests going out and change them before they arrive. Think of it as a mail interception service: you can open a letter, rewrite a line, and send it on.
No accounts, roles, software versions or other preconditions are described. The only stated starting point is access to a web application that had an endpoint which looked authentication-related and which returned CORS headers. An endpoint is simply one specific address on a server that does one job, like a particular counter in a large building. Authentication-related means it deals with logging in or with proving who you are.
Finding it
While testing the application, the author came across what appeared to be an authentication-related endpoint. Using Burp Suite, the author experimented with the Origin header. The Origin header is a line the browser adds to a request to say which website the request is coming from, for example the address of the page that made it. The author changed its value and noticed something interesting: the server was reflecting the supplied origin back in the response. In other words, whatever site the author claimed to be, the server repeated that claim in its answer.
Reflecting an origin is not automatically a bug. A server may legitimately echo back a site it has decided to allow. What made it interesting was the combination with credentials. The author suspected that the application was checking origins with a weak startsWith() check instead of properly validating the hostname.
startsWith() is a common instruction in programming: "does this piece of text begin with these characters?". It is like a bouncer who only checks that your name badge starts with the letter A, without reading the rest. The reasoning was as follows. If the application trusted origins beginning with:
https://targetdomain.com
then an origin such as:
https://targetdomain.com.attacker.com
could pass a prefix check even though it belongs to an entirely different domain, because the text begins with the trusted value. A correct check would compare the actual hostname exactly, or at least make sure the trusted value is followed by a separator such as a slash, not by an arbitrary extra label. The difference matters because targetdomain.com.attacker.com is a name that the attacker controls, not a part of targetdomain.com.
Trying it out
Step 1: Change the Origin header
Using Burp Suite, the author modified the Origin header value and saw the server reflect the supplied origin. The reason for this step is to test the guess: if the server only looks at the beginning of the text, this made-up origin should be accepted as if it were the real site.
Step 2: Look at the CORS headers in the answer
The response included:
Acess-Control-Allow-Origin: https://targetdomain.com.attacker.com
Access-Control-Allow-Credentials: true
Line by line:
Acess-Control-Allow-Origin: https://targetdomain.com.attacker.comis the server naming the site that may read its answer, and the site it names is the attacker-controlled one. This is what a prefix-based allowlist would produce. The header name is spelledAcess-Control-Allow-Originin the report as reproduced above, with the double c missing from the start of "Access".Access-Control-Allow-Credentials: truemeans the browser would be allowed to send the visitor's cookies with the cross-origin request and to show the answer to the calling script.
Together these two lines are the signature of a permissive CORS policy: the server is effectively telling the browser that the attacker's site may act as the logged-in user and read the reply.
Step 3: Explore subdomain takeover as a way in
One of the possibilities the author explored was subdomain takeover. A subdomain is a smaller address under a main one, such as shop.example.com under example.com. Companies often point such names at outside services, and sometimes they forget to keep the arrangement alive. If the outside service is no longer claimed, someone else can register it and take control of that name. That is a subdomain takeover: an unclaimed name that still belongs to the target's domain falls into someone else's hands.
The idea was that such a name might give another way to obtain an origin that the weak validation would trust, and from there to exploit the behaviour. The author could not find a takeover candidate, so this path did not lead anywhere.
Step 4: Send in the report
Despite the failed takeover exploration, the behaviour looked suspicious enough to investigate further, so the author submitted a report to HackerOne, a platform where security researchers send findings to companies. The result was a single word: Duplicate. Someone had already reported the same issue.

The image sits at the point in the story where the duplicate notification arrived, illustrating the outcome of the submission.
Why it happened
The author's assessment is that the application was using a weak startsWith() check to validate origins instead of properly validating the hostname. Under that design, any origin whose text begins with the trusted value, such as https://targetdomain.com.attacker.com, passes the check and is reflected in Access-Control-Allow-Origin. Because the answer also carries Access-Control-Allow-Credentials: true, the browser treats the attacker's site as trusted for reading replies that include the user's cookies.
The report does not show the server-side code, so the startsWith() explanation is the author's inference from the observed reflection, not a confirmed reading of the implementation. The author suspected the origin check was a prefix comparison rather than a hostname comparison, which would not limit the origin to the intended host.
What could have gone wrong
The author is explicit that impact was not established. Impact means what an attacker could actually do with the weakness, and how bad it would be. Seeing the origin reflected together with Access-Control-Allow-Credentials: true was exciting, but the author had not shown what an attacker could actually achieve. The question that mattered was not whether the server reflected an origin, but whether an attacker-controlled website could make an authenticated request and read sensitive information from the response. That end-to-end proof was never produced.
So the potential impact, under the conditions the author describes, is that a malicious site could send requests that carry the visitor's cookies to the affected endpoint and read the replies on behalf of a logged-in user. Whether that yields anything sensitive depends on what the endpoint returns and what the cookies grant, which the report does not establish. The subdomain takeover route, which might have supplied a trusted origin through another means, was explored and abandoned when no candidate was found.
Was it fixed?
The report does not say whether anything was changed, and it does not prescribe a fix. The weakness it describes would be addressed by validating the origin's hostname exactly rather than by prefix matching, so that https://targetdomain.com.attacker.com is not treated as https://targetdomain.com. Whether the program applied such a change is not stated.
Other versions worth trying
These follow from the mechanism the author describes and are worth trying on other targets:
- Prefix confusion with an extra label. Send
Origin: https://targetdomain.com.attacker.com. A positive result is that value echoed inAccess-Control-Allow-OriginalongsideAccess-Control-Allow-Credentials: true. - Prefix confusion with a different scheme or port. Try origins that begin with the trusted text but differ afterwards, for example a different port or a suffix that a naive comparison might ignore. A positive result is the same reflection with credentials allowed.
- Null origin. Send
Origin: nulland see whether it is reflected with credentials allowed. A positive result isAccess-Control-Allow-Origin: nullwithAccess-Control-Allow-Credentials: true. - Subdomain takeover as a source of a trusted origin. Look for unclaimed subdomains of the target that the origin check would trust. A positive result is a takeover candidate whose hostname passes the application's origin validation.
- End-to-end proof. For any reflected origin with credentials, build a page on the attacker origin that makes a request carrying the visitor's cookies to the endpoint and reads the reply. A positive result is sensitive data from the victim's session appearing in the attacker page, which is the evidence the author identifies as missing here.
Where to look next time
This kind of bug tends to hide on endpoints that serve logged-in, data-bearing replies and that implement CORS by hand: API endpoints, authentication-related endpoints, and anything that returns per-user data. An API is a set of addresses a program uses to exchange data with another program, rather than pages meant for a person to look at. The signal during testing is a reflected Origin value in Access-Control-Allow-Origin, especially when it is paired with Access-Control-Allow-Credentials: true. Reflection of an arbitrary origin is the clue; the prefix trick is the way to test whether the allowlist is doing a text comparison rather than a hostname comparison.
The lesson the author draws is about impact. A reflected origin and a credentials flag are a lead, not a finding. The question to answer before submitting is whether an attacker-controlled website can make an authenticated request and read sensitive information from the response. Proving that end to end is what turns the observation into a report with demonstrated impact. The author also notes that time spent on one possible attack path, such as subdomain takeover, may be better spent understanding the actual impact of the CORS behaviour itself. In this case the result was a duplicate, so someone had already reported the same issue.
Glossary
- Bug bounty: a scheme where companies reward people for reporting security problems to them instead of exploiting them.
- Duplicate: a report of a problem that someone else has already reported, so it does not count as a new discovery.
- Cookie: a small piece of information a website asks your browser to store and send back on later requests, often used to keep you logged in.
- Header: a line of extra information sent with a web request or response, such as which site a request comes from or what the server allows.
- CORS (Cross-Origin Resource Sharing): the controlled way a server tells the browser that a page from another site may read its answer.
- Origin: the combination of scheme, host and port that identifies where a web page came from, for example
https://targetdomain.com. Access-Control-Allow-Origin: the response header that names the one site allowed to read the answer.Access-Control-Allow-Credentials: true: the response header that says the browser may attach the visitor's cookies to the cross-origin request and let the calling script read the answer.- Endpoint: one specific address on a server that performs one job.
- Authentication-related: dealing with logging in or with proving who you are.
- Burp Suite: a tool that sits between your browser and a website so you can inspect requests and change them before they arrive.
Originheader: a line the browser adds to a request to say which website the request is coming from.- Reflecting: sending back in the answer a value that the caller supplied in the request.
startsWith(): a programming instruction that checks whether a piece of text begins with certain characters.- Hostname: the name part of a web address, such as
targetdomain.com. - Allowlist: a list of things that are permitted, here the origins a server trusts.
- Subdomain: a smaller address under a main one, such as
shop.example.comunderexample.com. - Subdomain takeover: taking control of an unclaimed subdomain that still belongs to the target's domain.
- HackerOne: a platform where security researchers send findings to companies.
- Impact: what an attacker could actually do with a weakness, and how bad it would be.
- API: a set of addresses a program uses to exchange data with another program, rather than pages meant for a person to look at.
- Port: a numbered channel on a server that a particular service listens on, part of the origin alongside scheme and host.