scVENUS / PeekabooAV

Peekaboo Extended Email Attachment Behavior Observation Owl
https://peekabooav.de
GNU General Public License v3.0
66 stars 20 forks source link

Handle URI-parameters-like notation in declared filenames #179

Closed michaelweiser closed 3 years ago

michaelweiser commented 3 years ago

After handling totally bogus filenames such as titles of forwarded emails in #165, we're now seeing attachments which have what looks like URI parameters attached to the filename:

Content-Type: image/png; name="foo.png?cache=1561614719286"

and:

Content-Type: application/octet-stream;
 name="0.11E67?OpenElement&FieldElemFormat=jpg"
Content-Disposition: inline;
 filename="0.11E7?OpenElement&FieldElemFormat=jpg"

The latter seems to be something specific to Lotus-Domino.

Even with the fix from #165 we still extract everything after the first dot as file extension and submit that as <hash>.png?cache=... to cuckoo. Since Cuckoo again does not cope well with this, we should consider cutting off everything atfer a ?. More generically we could parse the filename as URI and remove parameters. Or we look into making this an other-peoples'-problem and try to handle it in AMaViS.

Again, Wikipedia does not list any extensions with ?, ; or & in the name, likely for exactly the reason that they're used as URI parameter delimiter.