The Webform Anonymous module seeks to allow webform content node authors obscure the submitter's identifying information for a particular webform node. It does this by limiting the display of uid and ip address information that is store in the submission table.

This is inherently susceptible to a determined administrative user who can examine database tables or use other means to discover identifying information. The only real solution is to ensure that identifying information is not stored or is one-way encrypted in the database. See this Webform Anonymous issue: #2350497: Data not suffeciently anonymized

The IP address is actually used in only two placed in Webform:

  1. To report to the administrator via the error log an attempt to use Webform as an agent of spam. For valid users of a confidential survey, such a report should not be a concern (unless they are in fact spammers, in which case they don't deserve confidentiality).
  2. To limit the number of submission for anonymous (i.e. not authenticated) users. Webform offers three options for this: cookies, ip address, and both. For a confidential webform node, cookies only would automatically be used.

The proposed implementation would be to record the IP address as normal during the creation of a node by an anonymous user. This allow the IP address to be available for spam checking. Immediately before saving the submission (presave time), the IP address would be replaced with a bogus value, such as (unknown). The (unknown) IP address would continue to be displayed on webform submission and reports to reassure administrators that no IP addresses are being saved.

If the option is turned off, then only future submission would record data. If turned back on, any existing submissions would be sanitized with "(unknown)".

An attempt to submit a confidential webform from an authenticated user account with either be logged out first or (more likely) greeted with a message that the user needs to log out first.

CommentFileSizeAuthor
#3 webform-confidential-2477735-2.patch15.15 KBdanchadwick

Comments

danchadwick’s picture

Note: I would have liked to one-way encrypt the IP address because then it could be used for submission limit control. IP addresses, however are only 32 bits long (fewer in actual use -- not all IP address ranges are used). This isn't enough information to prevent a brute-force attack, even with a cryptographic salt.

Another feature: webform should display a status message to the submitter informing him/her that their IP address will not be recorded.

  • DanChadwick committed 77b2558 on 7.x-4.x
    Issue #2477735: Confidential submissions (aka Webform Anonymous).
    
danchadwick’s picture

Status: Active » Fixed
StatusFileSize
new15.15 KB

This patch:

  1. Defines the confidential option in the webform table and adds a hook_update_N function to default existing webform to off.
  2. Adds a UI to define the confidential option. When confidential, access control by submission is hidden, since by definition the submitter must be anonymous only. Also, it validates that you can't have confidential + per-user limit + anonymous user tracking by IP address only.
  3. The IP address stored in confidential submissions is "(unknown)".
  4. The email template was updated with a comment that the IP address will be unknown and user anonymous when the webform is confidential.
  5. The code to check for allowed roles was enhanced to first check for confidential submission.

This feature cost the maintainer about $400. Funding is appreciated.

Committed to 7.x-4.x.

danchadwick’s picture

Version: 7.x-4.x-dev » 8.x-4.x-dev
Category: Feature request » Task
Status: Fixed » Patch (to be ported)
fenstrat’s picture

Version: 8.x-4.x-dev » 7.x-4.x-dev
Category: Task » Feature request
Status: Patch (to be ported) » Fixed

Committed and pushed to 8.x-4.x. Thanks!

  • fenstrat committed 02ee62f on 8.x-4.x authored by DanChadwick
    Issue #2477735 by DanChadwick: Confidential submissions (aka Webform...
mortenthorpe’s picture

I notice that the "Confidential" IP address recorded for a submission is actually "(unknown)", which makes me wonder how this is a good solution as clashes with IP-respecting validators will immediately classify these submissions as spam.

I propose
- Replacing "(unknown)" by "127.0.0.1" or the servers own IP-address
- Adding a boolean-column specifying that the submission is "confidential" - Because the IP address alone being the servers IP may be a result of a proxy-setup, cloud-hosted site etc.

danchadwick’s picture

Re #7: please open a new issue. Also please explain your use case. If a webform node is confidential, the the assumption is the admin is trying to NOT use the IP address and would not include them in emails or otherwise validate them.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.