-
-
Notifications
You must be signed in to change notification settings - Fork 298
Description
According to the official Coraza documentation on the inspectFile operator, the FILES_TMPNAMES variable is only populated when the directive SecTmpSaveUploadedFiles is set to On:
Note: Coraza will not fill the FILES_TMPNAMES variable unless SecTmpSaveUploadedFiles directive is On, or the SecUploadKeepFiles directive is set to RelevantOnly.
After reviewing the source code, it appears that the SecTmpSaveUploadedFiles directive is not yet implemented. Instead, all uploaded files are written to disk unconditionally.
https://github.com/corazawaf/coraza/blob/main/internal/bodyprocessors/multipart.go#L61-L76
Expected Behavior:
Per default (SecTmpSaveUploadedFiles Off), uploaded files via multipart/form-data should not be streamed to disk. Only when SecTmpSaveUploadedFiles On is set, Coraza should persist uploaded files to disk, thereby populating the FILES_TMPNAMES variable.