Uploaded files content are not encrypted

Created on 10 March 2019, over 6 years ago
Updated 16 June 2025, 12 days ago

Problem/Motivation

When a webform has a managed_file element, which is set to be encrypted, only the value of the field is encrypted, but not the file itself. I think it's a fair assumption that this is not the expected behaviour.

The severity of this is mitigated for three reasons:

  1. Anonymous files can only be uploaded to private.
  2. The links to the files are only displayed if the user can see encrypted webform values.
  3. If someone tries to directly access the file by using a direct url, the user is required to have permission to view the webform submission.

Still, if someone could somehow figure out the internal path to the file, and had access to private files, they would see the unencrypted file.

Discovered while trying to reproduce #3035804: Access encrypted file uploaded by anonymous user

Proposed resolution

Figure out if we can actually encrypt the file's content before saving to disk.

Remaining tasks

  • Fix it.
  • Add test coverage.

User interface changes

None.

API changes

None?

Data model changes

None

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇪🇸Spain manuel garcia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom robcarr Perthshire, Scotland

    Six years on and File Encrypt still the only way to solve this. It works.

    The solution in this module (Webform Encrypt) apparently only encrypts the filename in the database

Production build 0.71.5 2024