zulip/zerver/lib/url_preview/parsers
Tim Abbott 4901dc3795 url_preview: Fix parsing of open graph tags.
Our open graph parser logic sloppily mixed data obtained by parsing
open graph properties with trusted data set by our oembed parser.

We fix this by consistenly using our explicit whitelist of generic
properties (image, title, and description) in both places where we
interact with open graph properties.  The fixes are redundant with
each other, but doing both helps in making the intent of the code
clearer.

This issue fixed here was originally reported as an XSS vulnerability
in the upcoming Inline URL Previews feature found by Graham Bleaney
and Ibrahim Mohamed using Pysa.  The recent Oembed changes close that
vulnerability, but this change is still worth doing to make the
implementation do what it looks like it does.
2019-12-12 15:24:38 -08:00
..
__init__.py
base.py url_preview: Don't import beautifulsoup at import time. 2018-08-08 14:19:42 -07:00
generic.py url preview: Return generic parser <p> text as str (not bs4 string). 2019-05-06 12:37:32 -07:00
open_graph.py url_preview: Fix parsing of open graph tags. 2019-12-12 15:24:38 -08:00