Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security Issue: Elaho executes HTML tags in text/plain responses #41

Open
acidus99 opened this issue Apr 10, 2022 · 0 comments
Open

Security Issue: Elaho executes HTML tags in text/plain responses #41

acidus99 opened this issue Apr 10, 2022 · 0 comments

Comments

@acidus99
Copy link

Hi, I’m a big fan of Elaho, and I discovered a security vulnerability in the latest version (possibly earlier ones as well)

If a file is served with a “text/plain” MIME type, Elaho will render HTML any tags it discovers, including <b>, <u>, but also link tags <a>. You can put a javascript: URI in the Link text, and if you click it, it executes JavaScript. Here is a screen shot of me popping a standard alert() box. You can also see some HTML tags rendered:

IMG_311EAAB3E740-1

You can test this yourself here: gemini://gemi.dev/hack.txt

I don’t know the full impact of this. I’ve only done a little digging but I am pretty worried about this. It really depends on what the what context / origin the JavaScript is executing in. I can see and call functions on the document and window object. At the very least I can alter the page, and trick the user, or start an infinite list of alert boxes, making the application unusable. Since Elaho reopens tabs on startup, the application would be very difficult to use since it would re-render (and lock up again) the malicious page.

I came across this because I was reading a text file and half of it was all using the Strike through style. Turns out the file had a <S> text sequence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant