]> Sergey Matveev's repositories - public-inbox.git/commit
wwwattach: prevent deep-linking via Referer match
authorEric Wong <e@80x24.org>
Mon, 23 Nov 2020 14:15:35 +0000 (14:15 +0000)
committerEric Wong <e@80x24.org>
Sat, 26 Dec 2020 19:42:16 +0000 (19:42 +0000)
commitc39ed01a3a4c6c4634642eb875a16538aceacfc3
tree2ad2c768a60634bc1bc5df7f9e5c3e137ddb4920
parent0366c73f20b436d4d5307a56c2b6ac93b115f23f
wwwattach: prevent deep-linking via Referer match

This prevents `<img src=' tags from being used to deep-link
image attachments from HTML outside of the current host and
reduces potential for abuse.

Some browsers (e.g. Firefox) favor content detection and will
display images irrespective of the Content-Type header being
"application/octet-stream", and "Content-Disposition: attachment"
doesn't stop them, either.

Tested with dillo and Firefox.

Reported-by: Leah Neukirchen <leah@vuxu.org>
(cherry picked from commit 46cbc5a7a4ba917bd7154be3b6e6898420ff85d3)
lib/PublicInbox/WwwAttach.pm