Summary
TensorZero's internal object-storage endpoint allows a caller-supplied storage path to override configured storage settings. Depending on the selected storage type, an attacker with gateway access may read arbitrary files from the gateway filesystem or cause requests to attacker-chosen internal and cloud-metadata endpoints.
Affected context
The issue occurs in TensorZero Gateway deployments where the /internal/object_storage endpoint is reachable and accepts a caller-controlled JSON storage_path parameter. Risk depends on whether the endpoint is exposed without authentication or to users who can invoke it, and on the gateway's filesystem permissions and network access. Filesystem-backed storage can expose local files, while S3-compatible storage can enable outbound requests to internal services or cloud metadata endpoints.
Exploit preconditions
- Attack surface: TensorZero Gateway
/internal/object_storageendpoint - Required access: Ability to reach and invoke the endpoint; authentication depends on deployment configuration
- Trigger point: Processing of a request containing a caller-controlled
storage_path - Why exploitation is possible: The endpoint dynamically uses caller-supplied storage configuration instead of restricting requests to trusted, preconfigured storage locations
Why this happens
The underlying bug is insufficient separation between trusted object-storage configuration and untrusted request data. Allowing a request parameter to dynamically select storage types and paths can bypass intended filesystem and network boundaries. This behavior maps primarily to CWE-552: Files or Directories Accessible to External Parties, because protected local files may become readable, and also relates to CWE-918: Server-Side Request Forgery, because attacker-controlled storage settings can influence outbound requests.
Potential impact
- Sensitive local files may be disclosed
- Credential material or service configuration may be exposed
- Requests may be sent to internal administrative services
- Cloud instance metadata or temporary credentials could be accessed
- Internal network topology and service information may be revealed
- Compromised credentials could enable further system or cloud-account access
General mitigation guidance
Mitigation generally focuses on keeping storage configuration server-controlled and reducing the trust placed in request parameters.
Common defensive patterns include:
- Restricting storage type, bucket, endpoint, and path values to validated server-side configuration
- Applying allowlists for permitted object-storage destinations and network schemes
- Preventing access to sensitive filesystem locations through dedicated storage roots and path canonicalization
- Blocking requests to loopback, link-local, private, and cloud-metadata address ranges where outbound access is unnecessary
- Applying network egress controls and least-privilege credentials to gateway workloads
- Requiring authentication and authorization for internal gateway endpoints
- Using separate identities and narrowly scoped permissions for object-storage operations
How teams detect issues like this
Detection can combine application, infrastructure, and source-code review controls:
- Use static analysis to identify request parameters that influence filesystem paths, storage clients, URLs, or endpoint selection
- Review code for dynamic configuration overrides and missing allowlists around object-storage parameters
- Monitor gateway requests for unusual storage types, filesystem paths, internal destinations, and metadata-service addresses
- Log denied path and outbound-network requests without recording sensitive file contents or credentials
- Enforce network policies that restrict gateway egress and alert on attempts to reach private or link-local ranges
- Use automated security review tools to flag file-access and SSRF data flows during development

