Form scope missing after interrupted file upload

Description

We have been investigating an error in our application that seems to be unique to Lucee that we had not previously seen in ACF. All values in the FORM scope are missing on occasion for a page that processes file uploads from a multipart/form-data POST.

 

We came across partial uploaded files in the Lucee temp directory correlated with the errors leading us to dig into the Lucee form processing code.

 

We have been able to reproduce a similar issue using the following steps (it is a bit convoluted, my apologies):

  • Start up Fiddler, select Rules->Performance->Simulate Modem Speeds (this helps to slow things down so you can do the remainder of the steps)

  • Submit an upload with a form similar to the index.html below and a 20MB file. The size isn’t too important, the larger file just gives you time to shut down fiddler.

  • Exit fiddler to simulate a network exception

 

The behavior we are seeing is that in lucee.runtime.type.scope.FormImpl#initializeMultiPart the call to getItemIterator() is returning with an empty iterator because the network exception is swallowed by lucee.runtime.net.http.HTTPServletRequestWrap#storeEL. This causes the initializeMultiPart method to exit without setting any exception condition and an empty Form scope.

 

The request continues processing as if no issue had occurred but the Form scope has no values.

 

We played around with not suppressing the exception in storeEL(). In that case, the catch clause in initializeMultiPart will set an initException. That was better but still not ideal since the network exception is not discovered until a call to the cffile tag; references to the FORM scope are mysteriously empty until then.

 

I suspect the desired behavior would be to abort the request in the case of an incomplete POST because of a network exception, or to throw an exception that can be caught in CF code.

 

We can test for the missing FORM scope as an error condition but figured we’d share our research into the issue in case a Lucee behavior change is warranted.

Environment

OS: Windows 10
Java Version: 11.0.7
Tomcat Version: 9.0.11
Lucee Version: 5.3.8.206

Attachments

1
  • 22 Apr 2022, 02:37 pm

Activity

Show:

Pothys - MitrahSoft 22 April 2022 at 14:37
Edited

I've checked this ticket and replicated the issue by using the above steps in the lucee version 5.3.9.125-SNAPSHOT

When I submit the form with file upload and exit the fiddler, the browser shows a proxy error, and the form scope values are missing on lucee. But for me, the temp folder didn't have any partially uploaded files in lucee

The log detail from processUpload.cfm on lucee with using the fiddler

"ERROR","ajp-nio-8009-exec-7","04/22/2022","19:06:40","","Form element count: 0" "ERROR","ajp-nio-8009-exec-7","04/22/2022","19:06:40","","request_method: POST" "ERROR","ajp-nio-8009-exec-7","04/22/2022","19:06:40","","Upload error: The required parameter [Form.MediaFile] was not provided."

HTML output of dump from processUpload.cfm

<cfdump var="#form#" label="Using fiddler" output="dump.html" format="html">

But While I did the same test in ACF, there are no logs and dump.html created from processUpload.cfm.
So will decide about the issue.

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 6 April 2022 at 17:46
Updated 22 April 2022 at 14:37

Flag notifications