Skip to content

Improve input validation in LocalBackend and default server binding#795

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

Improve input validation in LocalBackend and default server binding#795
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>
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.

1 participant