Postponed (maintainer needs more info)
Project:
Webform
Version:
6.3.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Oct 2026 at 13:07 UTC
Updated:
4 Nov 2026 at 17:55 UTC
Jump to comment: Most recent
Comments
Comment #2
priyankampatil commentedComment #3
liam morlandIs this a duplicate of #3625496: Managed file valueCallback() rejects a draft's own previously uploaded files, forcing re-upload on resume?
Comment #4
priyankampatil commentedNo, this is a completely different scenario. In our case, an anonymous user is unable to submit a webform containing a managed file field and receives “The uploaded file is invalid” error, whereas an authenticated user can successfully submit the same form with the same file field. This issue is not related to resuming a draft or re-uploading a previously uploaded file.
Comment #5
liam morlandIs this new between 6.3.0 and 6.3.1? Can you use
git bisectto figure out which commit caused the problem?Comment #6
cilefen commentedThis looks like another report of #3619282: Upgrade to 11.4.5, a Webform with a file upload field loses file on submit for anonymous from the same contributor.
Comment #7
priyankampatil commentedSimilar issue of file getting removed on webform submit caused by webform update from 6.3.0 to 6.3.1. #3619282: Upgrade to 11.4.5, a Webform with a file upload field loses file on submit for anonymous issue got resolved by reverting
#3593472: Insecure Direct Object Reference in Private File Uploadscode.Comment #8
rossb89 commentedYes we are getting this as well! But weirdly, not locally or on production, but when the production site that hosts a webform embedded on another website... weird!
This is the code that was added
valueCallback()https://git.drupalcode.org/project/webform/-/blob/19b86bcb011c857f67d789...That seems to be causing the issue. Still trying to work out why it's only happening when the site is in an iFrame..
We are also using the sf3s module for the private file system on production which may be relevant.
Comment #9
rossb89 commentedUpdate **fixed** : the issue for us was specifically around the fact our website with the webforms is included through iFrames on other known trusted websites. After doing the ajax upload for the file, the browser was blocking the cookie due to the
cookie_samesitevalue being the default ofLax. In our circumstance for this website and it's purpose, it is acceptable to set the policy toNoneto mitigate the issue and allow the session cookie to be set cross origin.Because of the check to
!$file->access('download')in the updated 6.3.1 webform code, core's file access control check runs indirectly here and checksanonymous_allowed_file_idsin the session to decide access for an anonymous file owner.The core code here https://git.drupalcode.org/project/drupal/-/blob/11.3.x/core/modules/fil... sets
anonymous_allowed_file_idsand then is checked here https://git.drupalcode.org/project/drupal/-/blob/11.3.x/core/modules/fil... to determine access.If it's missing from the session (i.e. due to the cross origin cookie not being allowed) then the check will fail and thus validation fails, causing the issue.
Comment #10
rossb89 commentedFurther to this ^ what I posted above did not fix this for Safari on desktop or iOS.
Had to do some funky stuff with adding some middleware to write in a Partitioned session cookie re https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Third-party_...
Which worked a treat, except still for older iOS (e.g. 18.5) where CHIPS isn't supported. So, I also added a workaround on the webforms in a little preprocess where we inject some JS on webforms where there is a file upload field, that will test if partitioned cookies are allowed, if not and the webform is currently embedded in an iFrame, output a link to the webform on the site it's hosted on so there are no third party cookie issues. We have redirection code anyway on this site that serves up the webforms after submission so the user ends up back on the original site after submission anyway.
Aside from adding some code to undo the work of the security fix, I couldn't see another way around this annoyingly!
Comment #12
lexxerlee commentedI ran into this issue and found a workaround that resolved it for me.
In:
around line 907, replace:
with:
From my debugging, the problem occurs when multiple file uploads are allowed.
In this case, the expected key can be nested inside
files_group,and
NestedArray::getValue()is unable to find the token using the original input structure.As a result,
$tokenbecomesNULL, the HMAC validation fails, and Webform throws:This patch was written quickly as a proof of concept and is still being tested against different configurations and file upload scenarios.
I cannot guarantee that it covers all edge cases yet, but it resolved the issue in my case.