Skip to content

security: check the inference request path with the API path rules - #103

Merged
tamirse merged 1 commit into
masterfrom
fix/inference-client-path-allowlist
Oct 29, 2026
Merged

tamirse merged 1 commit into
masterfrom
fix/inference-client-path-allowlist

Conversation

@tamirse

@tamirse tamirse commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

InferenceClient._build_url checked path only for . and .. segments. A path built from untrusted input could add query parameters or a fragment to a request that carries the inference key. The forms ..;/ and ..%252f also passed the check.

The checks of HTTPClient._add_base_url are now in verda.helpers.check_request_path. Both clients call it. The function rejects ?, #, . and .. segments, and characters outside an allowlist. HTTPClient uses the same allowlist as before. InferenceClient also allows :, because TensorFlow Serving uses it (my_model:predict).

run_sync and run on InferenceClient and Deployment now take a params argument, so that all inference calls can send query parameters.

Breaking changes:

  • InferenceClient rejects a query string or fragment in path. Use params.
  • InferenceClient rejects characters in path other than letters, digits, -._~, / and :.

…LOUD-2523]

`InferenceClient._build_url` checked `path` only for `.` and `..` segments.
A path built from untrusted input could add query parameters or a fragment
to a request that carries the inference key. The forms `..;/` and
`..%252f` also passed the check.

The checks of `HTTPClient._add_base_url` are now in
`verda.helpers.check_request_path`. Both clients call it. The function
rejects `?`, `#`, `.` and `..` segments, and characters outside an
allowlist. `HTTPClient` uses the same allowlist as before. `InferenceClient`
also allows `:`, because TensorFlow Serving uses it (`my_model:predict`).

`run_sync` and `run` on `InferenceClient` and `Deployment` now take a
`params` argument, so that all inference calls can send query parameters.

**Breaking changes:**
- `InferenceClient` rejects a query string or fragment in `path`. Use
  `params`.
- `InferenceClient` rejects characters in `path` other than letters,
  digits, `-._~`, `/` and `:`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tamirse tamirse changed the title security: check the inference request path with the API path rules [C… security: check the inference request path with the API path rules Oct 29, 2026
@tamirse tamirse self-assigned this Oct 29, 2026
@tamirse
tamirse merged commit 42f054d into master Oct 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants