Name Your Stack, and ChatGPT Stops Leaking Your Bot Token

https://hackernoon.imgix.net/images/KIqhpcNITFZaDFX3gk4bMIOCoFJ3-vq93bhq.png

The warning was there. That's what bothered me most.

I asked ChatGPT for "a simple HTML contact form for my website that sends each message to my Telegram." It gave me a clean, styled page with a <script> at the bottom holding const BOT_TOKEN = "YOUR_BOT_TOKEN", then a step telling me to replace the placeholder with a real token. Under all of that came a section headed "Important security warning": the token would be visible to anyone who opened the page source, and anyone could take over the bot.

Everything in that answer is correct. It's just in the wrong order for the person who asked. Someone who asks for a simple form pastes the code, adds the token, sends a test, watches the message arrive on their phone, and closes the tab. The form works, so nobody scrolls back down to the warning.

Twenty chats

I wanted to know...

Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE