JosiahWI opened a new issue, #14117:
URL: https://github.com/apache/trafficserver/issues/14117

   #13574 added an explicit `do_io_close()` of the request transform VC in 
`HttpSM::state_read_server_response_header()` when the origin's response 
arrives while the request body tunnel is still alive. That close runs whether 
or not the transform VC has already been closed and freed, so it can be a 
use-after-free.
   
   **Affected:** 10.1.5 (801b5e780a) and master (47734750ab).
   
   **Sequence**
   
   1. A request transform buffers the whole request body and then releases all 
of its output at once.
   2. The transform's tunnel producer finishes. 
`tunnel_handler_transform_read()` sees `self_consumer->alive == false`, calls 
`p->vc->do_io_close()`, and `TransformTerminus` deletes the 
`TransformVConnection`.
   3. The tunnel is still alive because the server consumer is still writing a 
large body (several MB) to the origin.
   4. The origin answers before reading the whole body (for example 413 or 
401). `state_read_server_response_header()` takes the "post body in transit" 
branch, calls `tunnel.abort_tunnel()`, and then 
`post_transform_info.entry->vc->do_io_close()` on the deleted object.
   
   The result is a virtual call through a freed object. We saw `traffic_server` 
abort with SIGABRT (`std::bad_function_call`).
   
   **Reproduce**
   
   - A request transform plugin that buffers the full body before writing any 
output.
   - An origin that sends `413` as soon as it reads the request headers, 
without reading the body.
   - A POST with a body of about 1–10 MB.
   
   Without the transform, the same request gets the 413 back normally. A 
transform that streams its output isn't affected, because it's still open when 
the response arrives. The existing `slow_post/quick_server.test.py` only covers 
that streaming case.
   
   ---
   posted with Claude Opus 5.5 by Josiah VanderZee
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to