Skip to content

curl with PUT method can upload a huge file (>2GB) on remote server but hangs and timeout #3352

Open
@jonathansmith9485

Description

@jonathansmith9485

Describe the bug
When we want to upload a huge file (>2GB) to a remote web site (Artifactory in our case) , our http client hangs indefinitely.
However, the file is correctly uploaded to Artifactory.

Logs and dumps
Output of:

  1. DebugLogs (level 9), cf attachments
  2. AuditLogs : this file is empty
  3. Error logs :

To Reproduce
On a GNU/Linux machine do :

dd if=/dev/urandom of=/tmp/2G.txt bs=1M count=2048
curl -u <myuser>:<my_api_key> -T /tmp/2G.txt 'https://artifactory.local/artifactory/generic/perf_debug/2G.txt

Then, the curlhangs.

Expected behavior
curl ends whithout error.

Server :

  • ModSecurity version (and connector): ModSecurity v3.0.12 and 3.0.14 with nginx-connector v1.0.3
  • WebServer: nginx-1.18.0
  • OS: GNU/Linux, Ubuntu 22.04

Rule Set (please complete the following information):

Additional context

  • The infrastructure is made like : client -> haproxy -> nginx(+ modesec) -> Artifactory
  • More than the file size , the time to upload is more than 250 seconds when the upload fails
  • The problem persists when we disable Core Security Rules usage
  • The only way to avoid the problem is to set modsecurity off; in my vhost configuration
  • Artifactory return a HTTP 201
  • HTTP method used is PUT
  • strace -> see attachments
  • TCP segment missing when modsec is enabled (on nginx machine, interface connected to haproxy machine) :
69719  272.819868  172.16.3.13  172.16.3.12  TCP  66  443 → 36912 [FIN, ACK] Seq=6734 Ack=2104577102 Win=2021120 Len=0 TSval=55543961 TSecr=2937796858

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.xRelated to ModSecurity version 3.x

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions