[feed.py] do your own sanitization for media embeds #1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
copied over from lumbung-feed-aggregator repo
do your own sanitization for media embedsto [feed.py] do your own sanitization for media embedsContext: the feed parsing library sanitizes a lot of html elements that could be otherwise used to inject crap or execute arbitrary code, which means that particular things such as videos and PDFs embedded in posts (both based on iframe) are not returned.
The feedparsing library maintains a allowlist of tags. I've implemented the exception by first adding
iframe
to the feedparser allowlist: https://git.autonomic.zone/ruangrupa/lumbunglib/src/branch/master/lumbunglib/feed.py#L199Secondly I implement another allowlist on top with 'trusted domains':
https://git.autonomic.zone/ruangrupa/lumbunglib/src/branch/master/lumbunglib/feed.py#L140
It is probably wise to keep the same level of carefulness as the library maintainers and only add very specific exceptions to the allow lists.