When “Safe” Isn’t Safe: Turning a Simple HTML Injection into a Real Security Story.
好的,我现在需要帮用户总结一篇文章的内容,控制在100字以内。首先,我得仔细阅读文章,理解其主要内容和重点。 文章主要讲述了一个关于反射式HTML注入漏洞的发现过程。作者和另一位安全研究人员一起,在一个认证端点发现了这个漏洞。他们通过测试client_id参数,发现输入的HTML代码被直接渲染,而没有进行适当的编码或清理。这导致了攻击者可以在信任的页面上注入任意HTML内容。 接下来,文章讨论了这个漏洞的影响。虽然没有XSS(跨站脚本攻击),但由于发生在认证相关的页面上,用户容易信任这些内容,从而增加了钓鱼和社会工程攻击的风险。这对公司来说意味着品牌声誉受损和潜在的安全问题。 作者还强调了即使没有XSS,这样的漏洞仍然有重大影响,尤其是在敏感的上下文中。最后,文章提到了修复措施和负责任的披露过程。 现在,我需要将这些信息浓缩到100字以内。要确保涵盖发现漏洞的过程、影响以及修复的重要性。同时,语言要简洁明了,避免使用复杂的术语。 可能的结构是:介绍漏洞类型、发现过程、影响、修复措施以及总结其重要性。 最后检查字数是否符合要求,并确保信息准确无误。 </think> 作者与另一位安全研究人员合作,在一个认证端点发现了反射式HTML注入漏洞。通过测试`client_id`参数,他们发现输入的HTML代码被直接渲染在页面上。尽管没有XSS风险,但该漏洞允许攻击者在信任页面上注入恶意内容,增加钓鱼和社会工程风险。修复措施包括输出编码和输入验证。此案例强调简单漏洞在敏感上下文中的潜在影响。 2026-4-23 06:2:19 Author: infosecwriteups.com(查看原文) 阅读量:17 收藏

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---4
如有侵权请联系:admin#unsafe.sh