Comfy-Org / Comfy-Org/ComfyUI_frontend

initDatadogRum allowedTracingUrls regex needs a comfy.org host boundary

Open Beginner friendly
#16,388 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

`src/platform/telemetry/initDatadogRum.ts` sets:

```ts
allowedTracingUrls: [/^https:\/\/[^/]+\.comfy\.org/]
```

This prefix match has no boundary after `.comfy.org`, so a lookalike host such as `https://api.comfy.org.example.com/v1/billing` also matches and would receive Datadog RUM distributed-tracing headers meant only for `comfy.org` itself.

## Context

Comfy-Org/platform#837 carries the byte-identical pattern in `plugins/datadog-rum.client.ts` (that file's own comment says it mirrors this one), and CodeRabbit flagged it there as a Security & Privacy / Major finding. That PR fixes its own copy by requiring a URL boundary immediately after `.comfy.org`:

```ts
allowedTracingUrls: [/^https:\/\/[^/]+\.comfy\.org(?::\d+)?(?:[/?#]|$)/]
```

`initDatadogRum.test.ts` currently only asserts `allowedTracingUrls: [expect.any(RegExp)]` — it doesn't exercise the regex's matching behavior at all, so there's no regression coverage here even for the existing pattern, let alone the lookalike-host gap.

## Scoped decision

Fixing this file is out of scope for platform#837 (different repo, different release train, no linked task here). This issue tracks applying the same anchor fix — and adding a lookalike-host regression test, mirroring `tests/unit/plugins/datadog-rum.client.test.ts` in platform#837 — to this file so the two implementations don't stay silently inconsistent.

Verified via `gh search code allowedTracingUrls --owner Comfy-Org`: platform and this repo (plus its `-private` mirror) are the only two implementations of this pattern in the org; no other open PR touches it.

Contributor guide

Open the contributing guide

Research direction

Start with src/platform/telemetry/initDatadogRum.ts and read initDatadogRum.test.ts, then compare the matching assertions with the mirrored tests in platform#837. Verify that valid comfy.org URLs match while lookalike hosts such as api.comfy.org.example.com do not, and ensure the regression test covers the boundary behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.