When “Safe” Isn’t Safe: Turning a Simple HTML Injection into a Real Security Story.
嗯,用户让我帮忙总结一篇文章,控制在100字以内,而且不需要用“文章内容总结”之类的开头。我得先仔细看看这篇文章讲的是什么。 文章是关于赏金猎人发现的一个反射式HTML注入漏洞。看起来他们是在测试一个认证相关的端点,参数client_id被反射到响应中,没有进行适当的编码。这样攻击者可以注入任意HTML,虽然没有XSS,但影响依然很大。 用户的需求是总结内容,所以我要抓住关键点:漏洞类型、影响、修复措施。还要注意字数限制,不能超过100字。 可能用户是安全领域的从业者或者学生,他们需要快速了解文章的核心内容。深层需求可能是希望得到简洁明了的信息,方便分享或学习。 我应该用简练的语言描述漏洞发现、影响和修复方法。确保涵盖反射式HTML注入、用户信任受损以及编码和CSP的重要性。 最后检查一下字数,确保在限制内,并且表达清晰。 </think> 赏金猎人发现一个认证端点的反射式HTML注入漏洞。攻击者可通过client_id参数注入任意HTML内容,尽管未执行JavaScript,但可能误导用户信任并引发钓鱼或社会工程风险。修复需对用户输入进行编码和验证,并实施CSP策略。 2026-4-23 06:2:19 Author: infosecwriteups.com(查看原文) 阅读量:15 收藏

kjulius

Press enter or click to view image in full size

In bug bounty hunting, not every vulnerability needs flashy payloads or JavaScript execution to matter. Sometimes, the simplest flaws — when placed in the right context — can quietly undermine user trust.

In this write-up, I’ll walk through how I discovered a Reflected HTML Injection vulnerability on an authentication endpoint, why it matters, and how it was responsibly disclosed and resolved.

Your regular self-taught Ethical Hacker kjulius 🪞🗿

This finding was discovered together with @Younghb0x1.

🎯 Target Overview

The target was an authentication-related endpoint:
For responsible disclosure, let’s call the website as “target”.

https://target-auth.domain.com/data/public/farewell?client_id=

At first glance, it looked like a standard logout/farewell page in an SSO flow. But as always, user-controlled parameters are worth testing — especially in auth flows.

🔍 Initial Discovery

While testing the application, I noticed that the client_id parameter was reflected in the response.

So I tried something simple:

<h1>Hello World</h1>
<p>Testing HTML Injection</p>

After URL encoding and sending the request, the response page rendered my HTML directly.

That’s when it became clear:

The application was reflecting user input without proper output encoding.

⚠️ The Vulnerability

Reflected HTML Injection

The endpoint was vulnerable because it:

  • Took user input from client_id
  • Injected it directly into the HTML response.
  • Did not sanitize or encode the output.

This allowed arbitrary HTML to be rendered in the browser.

🧪 Proof of Concept.

A crafted payload like this:

Press enter or click to view image in full size

Was successfully rendered on the page when passed through the URL:

https://target-auth.domain.com/data/public/farewell?client_id=...

Press enter or click to view image in full size

Result:

  • Headings displayed ✔
  • Paragraph rendered ✔
  • Clickable link injected ✔

No JavaScript execution occurred — but that doesn’t mean it’s harmless.

❌ Why This Is NOT XSS

I tested multiple XSS payloads, including:

  • "><script>alert(1)</script>
  • <img src=x onerror=alert(1)>
  • <svg onload=alert(1)>

All were blocked or sanitized.

Get kjulius’s stories in your inbox

Join Medium for free to get updates from this writer.

Remember me for faster sign in

So this was clearly:

✅ HTML Injection
❌ Not Cross-Site Scripting (XSS)

💥 Impact: Why This Still Matters

Even without JavaScript, this vulnerability sits on a trusted authentication endpoint — and that changes everything.

👤 Impact to Users.

  • Users may see attacker-controlled content on a trusted page.
  • Fake messages can be displayed (e.g., logout success, warnings).
  • Malicious links can be injected and clicked.
  • Increased risk of phishing and social engineering.

🏢 Impact to the Company.

  • Abuse of a trusted authentication domain.
  • Potential phishing campaigns leveraging legitimacy.
  • Brand reputation damage.
  • Indicator of weak input handling in sensitive areas.

🧠 Key Insight

This bug is a perfect example of something many beginners overlook:

“No XSS” does NOT mean “No impact.”

Context matters.

If this were on a random static page, it might be ignored.
But on an SSO/logout endpoint, users inherently trust what they see.

That trust is exactly what attackers exploit.

🛠️ Remediation

The fix is straightforward but critical:

  • Properly encode all user input before rendering.
  • Apply strict allow-list validation for client_id
  • Avoid reflecting authentication parameters in HTML.
  • Implement a Content Security Policy (CSP).

✅ Final Outcome

The vulnerability was:

  • Reported responsibly.
  • Accepted by the program.
  • Resolved.

Press enter or click to view image in full size

🤝 Collaboration

This finding was made together with @Younghb0x1 — shoutout for the teamwork and sharp testing mindset.

🧾 Final Thoughts

This was a reminder that:

  • Simplicity wins.
  • Context defines impact.
  • And clean, well-documented reports get accepted.

Not every bug needs to be “critical” to be valuable.

Sometimes, all it takes is:

A <h1> tag in the right place.


文章来源: https://infosecwriteups.com/when-safe-isnt-safe-turning-a-simple-html-injection-into-a-real-security-story-34332d4851df?source=rss----7b722bfd1b8d--bug_bounty
如有侵权请联系:admin#unsafe.sh