mirror of
https://github.com/bjc/prosody.git
synced 2025-04-03 21:27:38 +03:00
mod_http_file_share: Add file type filter
Unlike mod_http_upload, this can't be bypassed by uploading with a different file extension.
This commit is contained in:
parent
a98f3a3e64
commit
456ca909e2
3 changed files with 20 additions and 0 deletions
|
@ -50,6 +50,19 @@ Romeo receives:
|
|||
</error>
|
||||
</iq>
|
||||
|
||||
Romeo sends:
|
||||
<iq to='upload.localhost' type='get' id='1401d3b5-7973-486f-85b3-3e63d13c7f0e' xml:lang='en'>
|
||||
<request content-type='application/x-executable' filename='evil.exe' xmlns='urn:xmpp:http:upload:0' size='1000'/>
|
||||
</iq>
|
||||
|
||||
Romeo receives:
|
||||
<iq id='1401d3b5-7973-486f-85b3-3e63d13c7f0e' from='upload.localhost' type='error'>
|
||||
<error type='modify'>
|
||||
<not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>File type not allowed</text>
|
||||
</error>
|
||||
</iq>
|
||||
|
||||
Romeo disconnects
|
||||
|
||||
# recording ended on 2021-01-27T22:10:46Z
|
||||
|
|
|
@ -134,3 +134,4 @@ Component "pubsub.localhost" "pubsub"
|
|||
|
||||
Component "upload.localhost" "http_file_share"
|
||||
http_file_share_size_limit = 10000000
|
||||
http_file_share_allowed_file_types = { "text/plain", "image/*" }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue