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

JS in feed content isn't sanitized at all. #111

Open
AvverbioPronome opened this issue Jun 22, 2020 · 1 comment
Open

JS in feed content isn't sanitized at all. #111

AvverbioPronome opened this issue Jun 22, 2020 · 1 comment

Comments

@AvverbioPronome
Copy link

Expected behavior

I expect javascript in feed content NOT to be run

Actual behavior

Javascript in feed content runs

Steps to reproduce

  • put javascript in a feed (ie: <script>document.location.replace('https://example.com');</script>)
  • add feed to moonmoon
  • open main page on moonmoon

Moonmoon version

9.0.0-rc.3

@rdalverny
Copy link
Contributor

That's because of:

$this->set_stupidly_fast(true);

Switching it to false will filter out the JavaScript (among other things). See https://github.com/simplepie/simplepie/blob/1aec297145a150f627e6ed82b8b084e0c933def8/library/SimplePie.php#L1178-L1191 for the changes it implies.

Maybe we should make both the full trigger configurable (but not recommended), or make a custom selection of the features to turn on/off? At least to force $this->strip_htmltags(true).

rdalverny added a commit to rdalverny/moonmoon that referenced this issue Jan 15, 2022
It's almost the same config as `set_stupidly_fast(true)`
only we don't want to touch at `add_attributes`
(because it's valuable safety)
and we do want to strip specific tags
(among which <script>, see moonmoon#111).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants