Closed (duplicate)
Project:
Webform
Version:
7.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Plan
Assigned:
Unassigned
Reporter:
Created:
10 Oct 2016 at 21:18 UTC
Updated:
18 Aug 2017 at 21:30 UTC
Jump to comment: Most recent
I would like to brainstorm if there is anything webform itself could do to mitigate PSA-2016-003. The trouble is file fields that upload to the public file system when the form can be posted by anonymous users. So what could we do? These are just some ideas.
Comments
Comment #2
cilefen commentedComment #3
cilefen commentedComment #4
cilefen commentedI just posted a tiny sandbox module to enforce private files. This is what I will be using on my sites for now.
webformfileprivate.module:
webformfileprivate.install:
Comment #5
ilari.stenroth commentedIn case somebody has a use case to allow file submits to public file scheme but wants to be protected from malware bots with CAPTCHA or server side anti-virus scanners there's a patch to process temporary/non-validated files in Drupal's temporary file scheme: Webform issue #2816223: File component temporary uploads shouldn't be publicly reachable.
Comment #6
ilari.stenroth commentedHere's a patch to fix Webform insecure default setting for upload destination:
Webform issue 2816303: File upload destination should be private files by default if avaialble.
Comment #7
ilari.stenroth commentedAnd here's my last change proposal to mitigate PSA-2016-003:
Webform issue 2816405: Warn admin users on site status report page if insecure webforms are found.
Comment #8
ilari.stenroth commentedComment #9
jrockowitz commentedI just committed some of the thoughts and recommendations listed here to the YAML Form module (for D8).
I am fortunate that the YAML Form module has very small user base so defaulting all file uploads to private and disable public uploads is the best initial solution. Otherwise I added warnings to the 'Status report' and 'Managed file' element form. The below ticket includes screenshots of theses changes.
#2817535: Drupal file upload by anonymous or untrusted users into public file systems -- PSA-2016-003
#4 might be the best approach, since it is easy to setup private file uploads in D7.
Comment #10
cilefen commentedComment #11
liam morlandComment #12
liam morlandThese don't need to be both child and related.
Comment #13
liam morlandPrivate files is now the default in 7.x-4.x due to #2816303: File upload destination should be private files by default if available.
Comment #14
cilefen commentedAs #2816303: File upload destination should be private files by default if available covers the only two ideas I had, this is a duplicate, right?