Skip to content

Improve input validation in LocalBackend and default server binding - #795

Closed
andreahlert wants to merge 2 commits into
apache:mainfrom
andreahlert:feature/localbackend-input-validation
Closed

andreahlert wants to merge 2 commits into
apache:mainfrom
andreahlert:feature/localbackend-input-validation

Conversation

@andreahlert

Copy link
Copy Markdown
Collaborator

This change tightens input handling in the local tracking backend and updates the default dev server configuration.

Changes:

  • Validates project_id and app_id identifiers with a strict character allowlist
  • Adds a _safe_join() helper that resolves and bounds-checks paths against the configured base directory
  • Returns HTTP 400 for invalid identifiers or out-of-bounds paths
  • Defaults the tracking server to bind on 127.0.0.1 instead of 0.0.0.0

Includes regression tests for identifier and path validation.

- Adds identifier validation for project_id and app_id in LocalBackend
to ensure only safe characters are accepted.
- Introduces a path containment helper that resolves and validates
paths stay within the configured base directory.
- Changes the default tracking server bind address from 0.0.0.0 to
127.0.0.1 for local development, aligning with common practice.

Signed-off-by: André Ahlert <andre@aex.partners>
@github-actions github-actions Bot added the area/tracking Telemetry, tracing, OpenTelemetry label Jun 2, 2026
@andreahlert
andreahlert requested review from elijahbenizzy and skrawcz and removed request for skrawcz June 2, 2026 10:48
Signed-off-by: André Ahlert <andre@aex.partners>
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

This PR has had no activity for 96 days.
Closing to keep the PR list manageable.

Feel free to reopen when you are ready to continue.
If the branch has conflicts, a fresh PR against main might be easier.

@elijahbenizzy

Copy link
Copy Markdown
Contributor

@andreahlert thanks for this, and sorry it fell through the cracks on our side. Carried forward with your commit intact in #948, with a few more call sites covered and the helper shared with the client. That PR supersedes this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tracking Telemetry, tracing, OpenTelemetry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants