triton-inference-server / server

The Triton Inference Server provides an optimized cloud and edge inferencing solution.
https://docs.nvidia.com/deeplearning/triton-inference-server/user-guide/docs/index.html
BSD 3-Clause "New" or "Revised" License
7.76k stars 1.42k forks source link

[Logging]: Resource exhaustion with no limit on log files creation #6152

Open Kanupriyagoyal opened 11 months ago

Kanupriyagoyal commented 11 months ago

Description We have observed that upon invoking POST /v2/logging API, it creates a new file.

  1. Fuzzing with filenames on "log_file" POST body parameter, one can create multiple or infinite number of files leading to resource exhaustion.

  2. Also, upon providing an existing file as input to "log_file" parameter, one can possibly overwrite an existing legitimate file inside the container.

As part of testing, we were able to create more than 100 files in less than a minute and File name validation is not in place.

It can overload your Server and consume all of its resources. It is easily possible for a single user/client to exhaust server resources.

Error Log --> Multiple logfile creation with no limit and same file name overwritten

Screenshot 2023-08-07 at 3 18 05 PM

Triton Information r23.04

Are you using the Triton container or did you build it yourself? Same Instructions as build.py

To Reproduce Steps to reproduce the behavior. Parameter log_file Affected URL/API(s) POST /v2/logging

  1. send log_file with different names.

Describe the models (framework, inputs, outputs), ideally include the model configuration file (if using an ensemble include the model configuration file for that as well).

Expected behavior A clear and concise description of what you expected to happen.

Kanupriyagoyal commented 11 months ago

@dyastremsky: . Here is one more on the log resource exhaustion.It would be great if you help here.Thank you !

pradghos commented 11 months ago

Can we restrict number of log file creation or not allow/restrict user to create log file ? Thanks!

dyastremsky commented 11 months ago

Thank you for your feature request. We have filed a ticket (DLIS-5274) to investigate this enhancement.

rmccorm4 commented 11 months ago

CC @fpetrini15 just FYI

kpg993 commented 5 months ago

@dyastremsky Is it planned for any immediate release version. Thanks in advance!!

dyastremsky commented 4 months ago

This has not yet been prioritized.

nnshah1 commented 3 months ago

@pradghos , @Kanupriyagoyal , @kpg993

We are actively looking into this issue and are considering removing the capability to change the log file location / name via the REST / GRPC API.

Are there valid use cases where we want to allow for name changes but restrict the number?

OR would it be sufficient to restrict the log file name and location to be only settable via command line launch parameters?

CC: @rmccorm4 , @yinggeh

Kanupriyagoyal commented 2 weeks ago

@nnshah1 @rmccorm4 @yinggeh It should be fine to have single file with fixed name and location if no much impact on user functionality. On a precautionary measure, is there any way file size can grow and exhaust system resources.