Skip to content

[MTP Diagnostic Analysis] OpenTelemetry exports raw file paths, stdout/stderr, and stack traces without filtering #8411

Closed

Description

Summary

The OpenTelemetry result pipeline emits raw file paths, stdout/stderr, exception text, stack traces, and artifact paths directly into activity tags. Unlike the App Insights telemetry pipeline, there is no hashing, redaction, or opt-in gate for these potentially sensitive values.

Evidence

  • Q:\src\testfx\src\Platform\Microsoft.Testing.Platform\Telemetry\OpenTelemetryResultHandler.cs:122-126
    • yield return new("test.file.path", testLocationProperty.FilePath);
    • yield return new("test.line.start", ...)
  • Q:\src\testfx\src\Platform\Microsoft.Testing.Platform\Telemetry\OpenTelemetryResultHandler.cs:163-169
    • activity.SetTag("test.result", result);
    • activity.SetTag("test.result.exception.message", exception.Message);
    • activity.SetTag("test.result.exception.stacktrace", exception.StackTrace);
  • Q:\src\testfx\src\Platform\Microsoft.Testing.Platform\Telemetry\OpenTelemetryResultHandler.cs:194-200
    • activity.SetTag("test.stdout", string.Join(...))
    • activity.SetTag("test.stderr", string.Join(...))
    • activity.SetTag($"test.artifact.file[{index}].path", fileArtifactProperty.FileInfo.FullName);
  • Q:\src\testfx\src\Platform\Microsoft.Testing.Extensions.Telemetry\AppInsightsProvider.cs:54-78
    • the App Insights pipeline maintains a KnownUnhashedProperties allowlist
  • Q:\src\testfx\src\Platform\Microsoft.Testing.Extensions.Telemetry\AppInsightsProvider.cs:195-205,258-276
    • DEBUG builds assert that arbitrary string properties must be hashed or allow-listed.

Why this is a real issue

This is concrete, not theoretical: any configured OpenTelemetry exporter receives these raw values. Test stdout/stderr often contains secrets or environment-specific data, and full source/artifact paths expose local machine layout and repository structure. The privacy posture is also inconsistent with the App Insights telemetry codepath, which explicitly guards unhashed strings.

Suggested resolution

Add filtering/redaction controls for sensitive tags (at minimum file paths, stdout/stderr, exception messages/stack traces, artifact paths), and consider making the sensitive tags opt-in rather than on-by-default. Documentation should call out exactly which fields are exported.

Related issues

  • None found

Activity

  1. added
    area/mtp-extensions
    type/automation
    and removed on May 20, 2026
  2. added
    area/mtp-observability
    and removed
    area/mtp-extensions
    on Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/mtp-observabilitytype/automation

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions