| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| marimo | pip | > 0.9.20, < 0.16.4 | 0.16.4 |
The vulnerability, identified as GHSA-xjv7-6w92-42r7, is a proxy abuse issue in the /mpl/{port}/ endpoint of the marimo package. My analysis of the provided patch commit 0312706d5e594acdb405209b2c8d87c98f46b22b confirms this.
The root cause of the vulnerability was the _create_mpl_proxy_middleware function in marimo/_server/main.py. This function set up a proxy that forwarded requests made to /mpl/<port>/... to http://localhost:<port>/.... The critical flaw was in the nested mpl_target_url function, which extracted the port number directly from the URL path without any authentication or validation. This allowed an unauthenticated attacker to craft requests to arbitrary ports on the machine running the marimo server, potentially accessing sensitive internal services.
The patch addresses this vulnerability by completely removing the _create_mpl_proxy_middleware function and its associated middleware from the application setup in create_starlette_app. It replaces this functionality with a new, more secure routing mechanism defined in marimo/_server/api/endpoints/mpl.py. The new implementation uses a dictionary figure_endpoints to map a figure number to a legitimate port, preventing attackers from specifying arbitrary ports in the URL. The new _mpl_handler function now checks if a requested figure number is authorized before proxying the request.
Based on this analysis, the primary vulnerable function that would appear in a runtime profile during exploitation is the mpl_target_url function, which is nested within _create_mpl_proxy_middleware. The _create_mpl_proxy_middleware function itself is the source of the vulnerability as it is responsible for creating and configuring the insecure proxy middleware.
Ongoing coverage of React2Shell