โ† Back to list

How We Discovered a Stored HTML Injection in a Chatbot System ๐Ÿ•ท๏ธ

What happens when you feed HTML to a hungry chatbot? Spoiler: It gets digested without question!

Het Patel in InfoSec Write-ups ยท 2025-06-06 08:57 ยท 10 claps ยท 2.8 min read
#html-injection #xss-vulnerability #bug-bounty
Open on Medium โ†—
Wiki topics: ๐ŸŒ ยท Web Development ๐Ÿ”’ ยท Cybersecurity

How We Discovered a Stored HTML Injection in a Chatbot System ๐Ÿ•ท๏ธ

This write-up has been prepared under the guidance of Amish Patel, Lay Patel at Hacker4Help as part of our learning initiative on cybersecurity awareness.

๐Ÿ” Introduction

As budding cybersecurity enthusiasts, weโ€™re always on the lookout for vulnerable systems that can help us learn and sharpen our skills. One casual evening of testing led us โ€” Het Patel and **Kaif Shah โ€” to discover a Stored HTML Injection vulnerability** in the chatbot feature of redacted.co.in, an AI-driven platform that connects users with verified professional experts across various categories.

So Letโ€™s get started ๐Ÿ˜Ž

What is Stored HTML Injection? ๐Ÿ’ฅ

Before we dive into the juicy details, letโ€™s break down what Stored HTML Injection actually is (because not everyone speaks fluent hacker ๐Ÿค“):

Think of it like this: Imagine youโ€™re at a restaurant and the waiter takes your order without questioning it. You ask for โ€œspaghetti with a side of surprise ingredientsโ€ and the kitchen justโ€ฆ makes it. No questions asked. Thatโ€™s essentially what happens with stored HTML injection! ๐Ÿ

Hence, Stored HTML Injection occurs when user-supplied HTML content is not properly sanitized and is saved in the applicationโ€™s database. When this data is later rendered on a page, the HTML is executed directly, which could lead to defacements or further security issues such as phishing or XSS (if scripts are allowed).

This can lead to:

  • ๐ŸŽญ Page defacements (making websites look funky)
  • ๐ŸŽฃ Phishing attacks (tricking users)
  • โšก XSS vulnerabilities (if scripts sneak through)

The Setup: Where We Found It ๐Ÿงช

While exploring the AI chatbot feature of pyng.co.in, we noticed an input field where users could send messages. At first, it seemed harmless โ€” but our curiosity nudged us to test how it handled raw HTML.

Payload and Execution

We entered the following simple HTML tag as our message:

<h1>Hello from Het & Kaif</h1>

To our surprise, when the chat history was loaded on page refresh or revisit, the message was rendered exactly as HTML โ€” not escaped, not sanitized. This confirmed a stored HTML injection โ€” the HTML was being stored server-side and rendered client-side without any filtering.

We also tried several other payloads to confirm the injection:

<b style="color:red">XSS</b>
<i onclick="alert('XSS')">Click me</i>
<div style="background:red;padding:10px">Injected DIV</div>
<b style="color:red">XSS</b>

However, since JavaScript execution was fully disabled, despite attempting multiple payloads and bypass techniques, we were unable to achieve any successful execution.

Screenshot of Payload Execution

๐Ÿ“ฌ Responsible Disclosure

We followed responsible disclosure practices:

  • Reported the bug to the redacted.co.in team.
  • Shared steps to reproduce and suggestions to mitigate.

We did got the reply from support team:

They were already aware of the vulnerability so they marked our report as โ€œDuplicate Submissionโ€ ๐Ÿ˜ญ

About the Authors:

  • **Het Patel** โ€” Cybersecurity Enthusiast | Bug Hunter | Coffee Addict โ˜•
  • Kaif Shah โ€” Security Researcher | CEHv11 | CRTA | Top 4% THM | Bug Hunter

Happy Hacking! (Ethically, of course) ๐Ÿ˜‰๐Ÿ”’


๋ฉ”ํƒ€๋ฐ์ดํ„ฐ
post_id
6cbefe8b0718
slug
how-we-discovered-a-stored-html-injection-in-a-chatbot-system-๏ธ-6cbefe8b0718
url
https://infosecwriteups.com/how-we-discovered-a-stored-html-injection-in-a-chatbot-system-%EF%B8%8F-6cbefe8b0718
canonical_url
https://infosecwriteups.com/how-we-discovered-a-stored-html-injection-in-a-chatbot-system-%EF%B8%8F-6cbefe8b0718
author_url
https://medium.com/@hettt
status
ok
fetched_at
2026-06-10 08:17:25