I Found an Account Takeover Vulnerability Through Google Dorking | by Samadhan Shimple
The application's email confirmation links were indexed by Google and appeared to establish an authenticated session. The author found that a modified token from an expired confirmation link could still produce an authenticated session, potentially allowing an attacker to take over an account without the password.
Published on samadhanshimple.medium.com
Cybersecurity
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 an account takeover finding that started from Google Dorking rather than from a scanner or a custom tool. The author does not name the target application, the program or the platform, so the product and its owner are not identified here. What the report does describe is a registration and email confirmation flow: a user signs up with an email address, username and password, the application sends a confirmation link to that address, the user opens the link, the address is verified, and the user ends up authenticated and able to access the account.
The feature that matters is the confirmation link itself. In the author's observations the link did more than verify an email address: opening it also appeared to establish an authenticated session. That is the property the rest of the investigation turns on, because a link that both verifies and authenticates is effectively a temporary credential.

Setup
The report does not list tools, versions or a formal scope. The preconditions it does describe are:
- A search engine that has indexed the target's confirmation URLs, reached with a Google Dork.
- A test account created specifically for security testing, used to reproduce the behaviour on a link the author controlled.
- The ability to open confirmation links and observe where the application redirects and what session state results.
No intercepting proxy output, raw HTTP requests or response bodies are reproduced in the report, so the exact endpoints, parameters and headers are not available.
Finding it
The author had been hunting without interesting results and switched from the usual reconnaissance methodology to Google Dorking. One query stood out:
site:example.com inurl:token
The query restricts results to the target domain and to URLs containing the string token. The results contained two kinds of URL:
- An email confirmation link belonging to a user.
- A device confirmation link containing a token.
Both appeared to carry authentication-related tokens, which is why they were worth opening.
The device confirmation link was the first one tried. The application first displayed a message saying the link was no longer valid, then redirected to a profile settings page. Instead of the author's own profile, the page showed another user's account. The author initially believed it was their own account and changed some profile settings before realising what had happened, then stopped interacting with it. This suggested the device confirmation flow might be exposing an existing user's authenticated session. No proof of concept was captured at that moment; after logging out the author tried to reproduce it and the link no longer worked.
The email confirmation link was the second result. Opening it produced an error saying the email address had already been confirmed. That would normally end the investigation, but the author wanted to understand how the application handled confirmation links, so they first mapped the registration flow.
Exploitation
Step 1: Map the registration and confirmation flow
From observation, the flow was:
- A user enters an email address, username and password.
- The application sends an email confirmation link to the registered address.
- The user opens the confirmation link.
- The application verifies the email address.
- The user is authenticated and can access their account.
The detail that mattered was step 5: the confirmation link appeared to establish an authenticated session, not just flip a verified flag. That raised the question the rest of the work answers: what happens if someone obtains another user's email confirmation link?
Step 2: Examine the expired confirmation link
The author returned to the indexed email confirmation URL. Opening it produced the error that the address had already been confirmed. They then examined the URL structure and how the token parameter was handled.
The observation was that the backend did not treat the expired link as uniformly unusable. When the token was altered, the application behaved differently from the original expired token. A modified token could produce a different result. This was notable because a consumed confirmation link is expected to be rejected outright.
Step 3: Reproduce on a controlled account
To check whether the behaviour was limited to the publicly indexed links, the author registered a new test account and received a fresh confirmation link. They first used the original link and observed the expected behaviour. They then investigated the token-handling issue using that same test account.
The result was that the application established an authenticated session without the account password being entered again. That ruled out a misleading error message or an odd redirect: the session was real. The behaviour was recorded for the proof of concept.
The report does not include the modified token value, the request that carried it, or the response that followed, so the precise manipulation cannot be reconstructed from this write-up.
Root cause
Likely, the email confirmation and authentication logic did not consistently enforce server-side validation of the token. A confirmation token should be generated securely, bound to the intended account, and checked against its server-side state, and once consumed it should not be reusable to create another authenticated session. In this case a previously rejected confirmation flow could still produce an authenticated session under certain conditions, which points at the validation path rather than at the redirect or the error page.
The rejection of an already-used link was not consistently enforced: the backend still produced an authenticated session from a manipulated token under certain conditions.
Impact
The author frames the impact conditionally. An attacker who discovers an exposed confirmation link, through a search engine, a publicly accessible log or another disclosure channel, may be able to establish an authenticated session without knowing the account password, if the application incorrectly accepts a previously used or manipulated confirmation token.
Depending on the application's permissions and the affected account, that session could expose personal account information, private user data, account settings, other account-related functionality, and any sensitive resources available to the authenticated user. The author's accidental access to another user's settings page during the device confirmation test suggested that flow might expose an existing session.
The report does not state a bounty, a CVSS score or a confirmed severity from the program. The author's own suggested classification is:
| Field | Value |
|---|---|
| Vulnerability | Authentication Bypass / Account Takeover |
| Affected component | Email Confirmation Flow |
| Potential severity | High to Critical, depending on confirmed exploitability and affected account permissions |
| Related CWE | CWE-640 (Weak Password Recovery Mechanism for Forgotten Password), only if the affected flow is part of password recovery; otherwise a more appropriate authentication-related classification after reviewing the implementation |
The author notes that the exact CWE should follow the underlying root cause rather than the visible impact.
Fix
The report does not say whether anything was changed by the vendor. It lists the measures that should be applied:
- Enforce strict server-side token validation: every confirmation token checked against its original account, purpose, expiration time and current state.
- Make tokens single-use: once consumed successfully, a token becomes permanently invalid.
- Use cryptographically secure random tokens with sufficient entropy and no predictable or reversible relationships.
- Separate email verification from authentication: verification should not automatically create an authenticated session unless the authentication flow is carefully designed and securely implemented.
- Prevent search engine indexing of sensitive confirmation URLs, and invalidate URLs that were already exposed.
- Review existing authentication sessions and invalidate affected tokens and potentially compromised sessions if the flaw is confirmed.
Variants to test
- Other token-bearing links in search results. Run dorks such as
site:target inurl:token, and also try terms likeconfirm,verify,resetandmagic, then open the results. - Token mutation on consumed links.
- Device confirmation flows. Open an indexed device confirmation link and watch where it lands. A positive result is landing in an account that is not yours, as happened here.
- Verification versus authentication.
- Replay after logout.
- Indexing controls.
Lessons learned
The author's takeaway is that not every finding needs a complicated payload or an automated scanner; a simple search query can surface something worth investigating. Authentication-related links, including email verification, device confirmation, password reset and magic login links, deserve particular attention, because they become security-sensitive entry points when token validation is weak. A link that looks expired should not be trusted as secure until its server-side behaviour has been verified: never judge an application's security only by the error message it displays.
What happened, in plain words
A security researcher was hunting for bugs and getting nowhere with the usual tools. So he tried something much simpler: he typed a special search query into Google and looked at what the search engine had already found and stored. Among the results were links that websites normally send to people by email, links that confirm an email address or confirm a device. He opened one, and the website showed him somebody else's account settings page. Later, working with a test account he had made himself, he found that a confirmation link which the site said was already used up could still be made to log him in, without typing a password. That is the kind of flaw that can let an attacker take over an account, which is why it is called an account takeover.
The report does not name the website, the company or the bug bounty programme. It also does not give the exact web addresses, the exact requests or the exact values he changed. So this article explains the ideas and the steps, and shows the one piece of text the report quotes word for word: the Google search query.

The image at the top of the article is a decorative illustration, and the author labels it as AI generated. It is not a screenshot of the vulnerability.
The ideas you need first
Before the story makes sense, here are the basic building blocks, explained from zero.
A web page and a web server. When you type an address into your browser, the browser sends a request over the internet to a computer called a server. The server sends back a page. Everything you see in the browser is the result of that back and forth.
A URL. The address of a page, like https://example.com/confirm?[redacted] The part after the question mark is called the query string, and it carries small pieces of information called parameters. In that example the parameter is named tokenand its value isabc123`.
A token. A long, hard-to-guess string of characters that a website uses as proof that you are allowed to do something. Think of it like the code on a paper concert ticket: whoever holds the ticket gets in, and the ticket is only supposed to work once. A confirmation token is a token that proves you control an email address, or that a device belongs to you.
A session and a session cookie. When you log in, the server needs a way to remember you on the next page you open. It gives your browser a small piece of data, stored in a file called a cookie, and your browser shows it on every later request. That cookie is what keeps you logged in. If someone else gets a valid session cookie, the server treats them as you. This is why a link that quietly creates a session is dangerous: it is effectively handing out a logged-in cookie.
Authentication. Proving who you are, usually with a password. Authorisation is what you are then allowed to do. An authentication bypass means getting past the proof-of-identity step without actually proving anything.
Account takeover. When an attacker gains access to somebody else's account. It is one of the most serious outcomes in web security, because everything the real user can see and do becomes available to the attacker.
Google Dorking. Google and other search engines constantly crawl the web and store copies of pages in a huge index. A dork is a carefully written search query that uses special operators to find very specific things in that index. For example, site: limits results to one website, and inurl: limits results to addresses containing a certain word. It is like using the index at the back of a book instead of reading every page: you are not breaking in anywhere, you are just searching what is already public.
A confirmation link. When you sign up somewhere, the site usually emails you a link and asks you to click it. Clicking proves the email address is really yours. The link contains a token so the site knows which signup it belongs to.
A device confirmation link. A similar idea, used when you add a new device, such as a phone or a laptop, to an account. The site emails or shows you a link, and opening it confirms the device.
Server-side validation. The server, not the browser, must be the one deciding whether a token is good. The browser can display any message it likes, but the real decision happens on the server. A common mistake is for the page to show an error while the server quietly still accepts the token.
Single-use token. A token that stops working the moment it has been used once. Like a stamp on your hand at an event: once you are inside, the same ticket should not let a second person in.
CWE. A catalogue of common weakness types, each with a number, used to describe what class of mistake a bug belongs to. CWE-640, mentioned later, is the entry for a weak password recovery mechanism.
The beginning: random Google Dorking
The author had been hunting for bugs for a while without finding anything interesting and was getting frustrated. Instead of following his usual reconnaissance method, which means the structured process of mapping out a target's systems before testing them, he started experimenting with Google Dorking.
After trying several queries, one caught his attention:
site:example.com inurl:token
Line by line, in plain words:
site:example.comtells Google to return only pages from that one domain.example.comis a placeholder here; the report does not reveal the real domain.inurl:tokentells Google to return only pages whose address contains the wordtoken.- Put together, the query asks: show me every page on this website whose address contains the word token.
Why do this? Because if a website puts secret tokens in its addresses, and those addresses end up in Google's index, then the tokens are effectively public. The search engine has done the discovery work for you.
The results showed two interesting kinds of address:
- An email confirmation link belonging to a user.
- A device confirmation link containing a token.
Both looked like they carried authentication-related tokens, meaning tokens that prove identity. At first the author did not think much of them; he was just looking at what was publicly indexed. But these two links led somewhere unexpected.
An unexpected discovery: the device confirmation link
He started with the second result, the device confirmation link.
When he opened it, the application first showed a message saying the link was no longer valid. Then it redirected him to a profile settings page. A redirect is when one page automatically sends your browser to another address.
Here is where it became interesting. Instead of his own profile, he was looking at another user's account. At first he genuinely thought it was his own account, because the site had redirected him to a settings page and he did not immediately realise whose it was. He even changed some profile settings before understanding what had happened. Once he realised, he stopped interacting with the account.
Why does this matter? Because it suggested the device confirmation flow might be exposing an existing user's logged-in session. In other words, opening a link that was supposed to be dead appeared to log him in as somebody else.
Unfortunately, he had not recorded a proof of concept at that moment. A proof of concept, often shortened to PoC, is a set of steps or a demonstration that reliably reproduces a bug. Without one, a finding is hard to report. He logged out and tried to reproduce the behaviour, but the link no longer worked. He thought he had lost the finding.
The second discovery: email confirmation links
He went back to the first search result, the email confirmation link.
Opening it produced an error saying the email address had already been confirmed. Normally that would be the end of the investigation: the link is used up, nothing to see.
But something about the authentication flow caught his attention. He wanted to understand how the application handled email confirmation links, so before going further he looked at how registration worked.
Understanding the email confirmation flow
From his observations, the registration process worked roughly like this:
- A user enters an email address, username and password.
- The application sends an email confirmation link to the registered email address.
- The user opens the confirmation link.
- The application verifies the email address.
- The user is authenticated and can access their account.
One detail stood out. The confirmation link did more than simply verify an email address: it also appeared to establish an authenticated session. That is, clicking it did not just tick a box saying "this email is real", it logged you in.
This raised an important question: what would happen if someone obtained another user's email confirmation link? If these links could log people in without a password, then an exposed confirmation link could become a way to take over an account.
Why map the flow first? Because you cannot judge whether a behaviour is a bug until you know what the behaviour is supposed to be. Understanding the normal path tells you which step is doing more than it should.
Investigating the expired confirmation link
He returned to the email confirmation address he had found through Google. Opening it gave the error that the address had already been confirmed.
He then examined the structure of the address and how its token parameter was handled. He noticed something unusual about the way the application handled certain token values. Rather than treating the expired link as completely unusable, the backend appeared to behave differently when the token was altered. After investigating, he found that a modified token could produce a different result from the original expired token.
Why is that notable? Because a confirmation link that has already been used is supposed to be rejected outright. If changing the token changes the outcome, the application is not consistently enforcing the expected validation.
The report does not say what the token looked like, what he changed it to, or what the different result was. It only describes the observation.
He then tested the behaviour using an account he had created specifically for security testing. Using your own account is standard practice: it keeps the test safe and legal, and it lets you repeat the steps as often as you need.
Testing the behaviour with my own account
To check whether this was limited to the publicly indexed links, he registered a new test account. After registration he received a fresh email confirmation link.
He first used the original link and observed its expected behaviour. Then he investigated the token-handling issue using his own test account.
The result was surprising: the application established an authenticated session without requiring him to enter his account password again. In plain terms, the site logged him in without a password.
This confirmed that the issue was not simply an unusual redirect or a misleading error message. There was a real problem in the way the email confirmation token was validated and handled. He recorded the behaviour for his proof of concept.
What was actually wrong?
The main issue appeared to be in the application's email confirmation and authentication logic.
An email confirmation token should be generated securely, uniquely associated with the intended account, and validated against its server-side state. Once a confirmation token has been consumed, it should not be possible to reuse it to establish another authenticated session.
In this case, his testing suggested the application was not consistently enforcing the expected validation. The unusual token handling allowed a previously rejected confirmation flow to produce an authenticated session under certain conditions.
Why is this especially concerning? Because email confirmation links act as temporary credentials. A credential is anything that proves who you are, like a password or a key. If a link works as a credential, then anyone who gets the link gets the credential.
Why is this vulnerability dangerous?
The potential impact is significant. Consider this scenario: an attacker discovers an exposed confirmation link through a search engine, a publicly accessible log, or another source of information disclosure. If the application incorrectly accepts a previously used or manipulated confirmation token, the attacker may be able to establish an authenticated session without knowing the account password.
Depending on the application's permissions and the affected account, this could expose:
- Personal account information.
- Private user data.
- Account settings.
- Other account-related functionality.
- Any sensitive resources accessible to the authenticated user.
The most concerning part is that the attacker might not need the victim's password. That is what makes proper token validation so important.
Potential security classification
Based on the observed behaviour, the issue could be classified as:
| Field | Value |
|---|---|
| Vulnerability | Authentication Bypass / Account Takeover |
| Affected component | Email Confirmation Flow |
| Potential severity | High to Critical, depending on confirmed exploitability and affected account permissions |
| Related CWE | CWE-640 (Weak Password Recovery Mechanism for Forgotten Password), only if the affected flow is part of password recovery; otherwise a more appropriate authentication-related classification after reviewing the implementation |
The author notes that the exact CWE should depend on the underlying root cause rather than simply the visible impact. In plain words: label the bug by what actually went wrong inside the code, not just by what an attacker could do with it.
How should this be fixed?
There are several measures that can help prevent this type of issue.
- Enforce strict server-side token validation. Every confirmation token should be checked against its original account, purpose, expiration time and current state. In everyday terms: the bouncer at the door checks the ticket against the guest list every single time, not just once.
- Make tokens single-use. Once a confirmation token has been successfully consumed, it should become permanently invalid.
- Use cryptographically secure random tokens. Confirmation tokens should have enough randomness that they cannot be guessed, and should not expose predictable or reversible relationships. A token like
12345or one built from your username is guessable; a long random string is not. - Separate email verification from authentication. Email verification should not automatically create an authenticated session unless the application has a carefully designed and securely implemented authentication flow. Verifying an address and logging someone in are two different jobs.
- Prevent search engine indexing. Sensitive confirmation addresses should not be publicly indexed. Appropriate indexing controls should be applied, and addresses that were already exposed should be invalidated. Indexing controls are instructions to search engines, such as a
noindextag, telling them not to list a page. - Review existing authentication sessions. If a token validation flaw is confirmed, affected tokens and potentially compromised sessions should be invalidated.
Variants to test
If you want to look for similar issues yourself, these are the angles the report suggests.
- Other token-bearing links in search results.
- Token mutation on consumed links.
- Device confirmation flows. Open an indexed device confirmation link and watch where it lands. A positive result is landing in an account that is not yours, as happened here.
- Verification versus authentication.
- Replay after logout.
- Indexing controls.
Lessons learned
The author's takeaway is that not every finding needs a complicated payload or an automated scanner; a simple search query can surface something worth investigating. Authentication-related links, including email verification, device confirmation, password reset and magic login links, deserve particular attention, because they become security-sensitive entry points when token validation is weak. A link that looks expired should not be trusted as secure until its server-side behaviour has been verified. Never judge an application's security only by the error message it displays.
Glossary
- Account takeover: gaining access to somebody else's account, usually without their password.
- Authentication: proving who you are, typically with a password or a token.
- Authentication bypass: getting past the identity check without actually proving identity.
- Authorisation: what a logged-in user is allowed to do.
- Backend: the server-side part of an application that the user does not see, where the real decisions are made.
- Confirmation link: a link sent by email or shown by a site that proves you control an address or a device.
- Cookie: a small piece of data a website stores in your browser, often used to keep you logged in.
- Credential: anything that proves who you are, such as a password, a key or a working login link.
- CWE: a numbered catalogue of common software weakness types.
- CWE-640: the catalogue entry for a weak password recovery mechanism.
- CVSS: a scoring system for how severe a vulnerability is.
- Device confirmation link: a link that confirms a new device, such as a phone or laptop, belongs to an account.
- Domain: the main part of a web address, such as
example.com. - Google Dorking: using special search operators to find specific pages in a search engine's index.
- Index (search engine): the stored copy of web pages that a search engine searches through.
- Indexing controls: instructions such as
noindexthat tell search engines not to list a page. - Information disclosure: accidentally making private information public.
- Magic login link: a link that logs you in without a password, usually sent by email.
- Noindex: a tag telling search engines not to include a page in results.
- Parameter: a named value in a web address, such as `[redacted]
- Payload: the crafted input an attacker sends to try to trigger a bug.
- Proof of concept (PoC): a recording or set of steps that reliably demonstrates a bug.
- Query string: the part of a web address after the question mark, carrying parameters.
- Reconnaissance: the structured process of mapping a target before testing it.
- Redirect: when one page automatically sends your browser to another address.
- Replay: sending the same request or opening the same link again.
- Server: the computer that hosts a website and answers browser requests.
- Server-side validation: checking data on the server rather than trusting the browser.
- Session: the server's memory of you being logged in.
- Session cookie: the cookie that carries your session and keeps you logged in.
- Single-use token: a token that stops working after it has been used once.
- Token: a long, hard-to-guess string used as proof of permission.
- URL: the address of a page on the web.
- Vendor: the company that owns or runs the application.