Skip to content

SecTmpSaveUploadedFiles directive not implemented #1439

@arminabf

Description

@arminabf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions