Token Leakage via Referrer — The Invisible Slip to Third Parties
文章描述了一种通过Referer头泄露密码重置令牌的安全漏洞。攻击者可通过第三方网站获取敏感重置链接,导致账户接管等风险。修复建议包括设置Referrer-Policy为no-referrer或移除敏感令牌。 2025-7-29 07:31:29 Author: infosecwriteups.com(查看原文) 阅读量:19 收藏

Sidhartha

Hi Researchers this is my 3rd Blog

👉 Reported to: United States Agency for Global Media (USAGM)
🏆 Status: Recognized in the Hall of Fame
🔍 Vulnerability: Token Leakage via Referrer (3rd Party)

Zoom image will be displayed

Have you ever clicked a password reset link in your inbox and wondered who else could be watching? In this write-up, I’ll share how I discovered a sensitive token leakage via the Referer header that exposed reset links to third-party websites — silently, and without the user ever noticing.

This wasn’t just any bug. It was a classic case of “referrer-based data exposure” — a subtle yet impactful misconfiguration many developers overlook.

Let’s break it down!

The Referer header is sent by browsers to indicate the origin of a request. This is useful for analytics, logging, and even for basic security purposes. However, if you're not careful, it might leak sensitive tokens or session data to external websites — which could lead to account takeovers or unauthorized access.

In this case, a password reset token was being exposed to third-party domains through a careless redirect.

Join our Telegram Channel for Resources : https://t.me/anon_courses

Follow these steps to understand how the issue was discovered:

  1. 🔗 Navigate to target.com.
  2. 👤 Go to the “Forgot Password” section.
  3. 📩 Submit a valid email to receive a reset link.
  4. 📬 Open the password reset link from your email inbox.
  5. 🔍 Intercept the request using a proxy tool like Burp Suite.
  6. 🌐 Click any third-party social media link from that page, like Facebook or LinkedIn.
  7. 🧾 Check the outgoing request’s headers, specifically the Referer header.
  8. What You’ll See:

The Referer header includes the full password reset URL, including the reset token.

Referer: https://target.com/reset-password?token=abcd1234efgh5678

Now imagine that this request goes to https://facebook.com/.... Congratulations — you just handed over a valid password reset token to a third-party site. 🚨

  • > In my Case it Leaked in analytics.google.com
POST /g/collect?v=2&tid=G-RSEVC9QJN8&gtm=45je57n0v916504977za200zd9165074977&_p=1753614378991&gcd=13l3l3l3l1l1&npa=0&dma=0&tag_exp=101509157~103116026~103200004~103233427~104684208~10684211~104948813&cid=444743719.1753559216&ul=en-us&sr=1056x594&_ng=1&ir=1&frm=0&pscdl=noapi&_eu=EAAAAAQ&_s=2&dp=%2Freset-password%2Fu%2FUDOD3RQZO2MFXIDN3GLRZOQVRGJIUCQALD26HS63VPKRKIZH27BQ%3D%3D%3D%3D&dt=Confirm%20Password%20Reset%20-%20Numerai&dl=https%3A%2F%2Fnexample.com%2Freset-password%2Fu%2FUDOD3RQZO2MFXIDNGLRZOQVRGJIUCQALD26H63VPKRKIZH2BQ%3D%3D%3D%3D&sid=175364188&sct=2&seg=1&en=page_view&_ee=1&tfd=1654 HTTP/2
Host: analytics.google.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Referer: https://example.gov/
Origin: https://example.gov
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: cross-site
Priority: u=6
Pragma: no-cache
Cache-Control: no-cache
Content-Length: 0
Te: trailers

This vulnerability silently leaks sensitive password reset tokens to third-party domains without any user alert.

  • An attacker could phish or lure a victim into clicking a social media icon during password reset.
  • The third-party site logs the referer header.
  • Anyone with access to that log (admin or attacker) can extract the token.
  • They now have full control over the victim’s account.

In worst-case scenarios, this can lead to:

  • Unauthorized access to user accounts
  • Data modification or deletion
  • Financial fraud (if accounts are linked to transactions)
  • Privilege escalation within the application

If you’re a developer or part of an engineering team, here’s how to patch this:

  • Set Referrer-Policy to no-referrer or strict-origin
<meta name="referrer" content="no-referrer">
  • You can also apply this via HTTP headers:
CopyEdit
Referrer-Policy: no-referrer
  • Alternatively, remove sensitive tokens from URLs and use secure sessions or POST parameters.

Token leakage via referrer is like whispering secrets in a crowded room. You may think no one’s listening — but someone always is.

This bug might look small at first glance, but it reflects a common blind spot in web app security. By staying alert to these details, we can all contribute to building safer applications.

Thanks to the United States Agency for Global Media (USAGM) for acknowledging this issue and including me in their Hall of Fame. Every recognition reminds me that ethical hacking has the power to create real-world impact.

If you’re in the bug bounty community or just getting started, never underestimate the power of testing the basics — they often hide the biggest risks.


文章来源: https://infosecwriteups.com/token-leakage-via-referrer-the-invisible-slip-to-third-parties-9c8d326dd52c?source=rss----7b722bfd1b8d---4
如有侵权请联系:admin#unsafe.sh