Repository navigation
fix(webui): validate run_id parameter across API endpoints - #510
Open
imshubham22apr-gif wants to merge 1 commit into
Open
imshubham22apr-gif wants to merge 1 commit into
imshubham22apr-gif wants to merge 1 commit into
Conversation
Signed-off-by: imshubham22apr-gif <imshubham.22apr@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validates the
run_idpath parameter in the WebUI service across all API routes and dashboard detail views to enforce safe alphanumeric identifiers (^[a-zA-Z0-9_\-]+$), returning HTTP 400 for invalid inputs and preventing unexpected globbing or file-system traversal.Changes
oss-crs-infra/webui/main.py:RUN_ID_REGEX = re.compile(r"^[a-zA-Z0-9_\-]+$")and_validate_run_id(run_id)._validate_run_id(run_id)into_get_or_create_run(),run_status(),run_history(),run_detail(), and artifact inspection/download routes (/api/runs/{run_id}/artifacts*and/run/{run_id}/artifacts/{atype}).oss_crs/tests/unit/test_webui_server.py:TestClientverifying/health, registration and status queries for valid run IDs, and parameterized checks asserting HTTP 400 rejection on invalid run identifiers containing injection tokens, wildcards, spaces, or illegal punctuation.CHANGELOG.md:[Unreleased] ### Changed.Testing
uv run pytest oss_crs/tests/unit/test_webui_server.py(9 passed)uv run ruff checkanduv run ruff format --check(clean)uv run pyright(clean)